I am trying to write a shell script to move a directory tree and play every mp3 file that it finds. afplay is my choice utility, given that I am on a mac. However, afplay only takes one argument at a time, so you need to call it over and over again if you want it to continue playing. It seems that the simplest solution would be the following:
$(`find . -name *.mp3 | awk '{ print "afplay \047" $0 "\047"; }' | tr '\n' ';' | sed 's/;/; /g'`)
... but something is stopping you from escaping quotes. For a quick reference, \ 047 is the octal for '(single quotation mark), which should encapsulate the arguments into one, but for some reason this is not the case. I do not know what is going on here.
user51058
source
share