I'm trying to add the output of a script to a CocoaDialog textbox - problem is - it's only printing the first line....
For example - Please see below:
$ cat TEST.txt
i
am
legend
$ /Applications/CocoaDialog.app/Contents/MacOS/CocoaDialog textbox --debug --text `while read line; do echo $line; done < TEST.txt` --button1 "Close"
After running this the output is just "i"
Any ideas?
Cheers
Replace
`while read line; do echo $line; done < TEST.txt`
with"`while read line; do echo $line; done < TEST.txt`"
, or preferably"$(<TEST.txt)"
.read
strips characters inIFS
from the start and end of lines.read
also interprets backslashes without-r
.echo $line
strips and collapses characters inIFS
.