I'm having a problem with filenames having whitespace in a bash script on Mac OSX:
name="My File" #file name
version="1.0.0"
echo "Copying AAX..."
mkdir aax/
cp -R "/Library/Application Support/Avid/Audio/Plug-Ins/""${name}".aaxplugin aax
echo "Copying AU..."
mkdir au/
cp -R "~/Library/Audio/Plug-Ins/Components/""${name}".component au
echo "Copying VST2..."
mkdir vst/
cp -R "~/Library/Audio/Plug-Ins/VST/""${name}".vst vst
It goes perfectly fine with the AAX file, but it won't find the file for AU and VST. I tried quoting different parts of the command lines, but I always get “no such file or directory” for those two.
What's wrong there?
Thanks!
Two things:
~
) does not expand in quotes; use $HOME
instead if you want to use it that way. ${name}
should be double-quoted (to prevent word-splitting). So that would look like this ( 1
):
"$HOME/Library/Audio/Plug-Ins/Components/${name}".component au
Or like this ( 2
):
~/Library/Audio/Plug-Ins/Components/"${name}".component au
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.