Apple or BASH script to automatically install multiple apps I would like to create a script to install a group of programs. The PKG files reside on a Windows file share.

I current can install them one at a time through the Terminal using the following syntax:

sudo installer -store -pkg "/Volumes/{Path to package}" -target /


But when I try to include this into my installer.sh script I get a syntax error that part of the path contained in quotes is an invalid option. It seems that the double quotes around my path are not being included when passed into the shell.

So I tried escaping the quotes by adding a \ in front of each double quote and I get the same error. Am I supposed to escape my quotes some other way?

installer -store -pkg “/Volumes/ChiefGeneral/TechGeneral/Misc/Batch Install/X6/Chief Architect Premier X6.pkg” -target /
installer -store -pkg “/Volumes/ChiefGeneral/TechGeneral/Misc/Batch Install/X6/Chief Architect Interiors X6.pkg” -target /
installer -store -pkg “/Volumes/ChiefGeneral/TechGeneral/Misc/Batch Install/X6/Chief Architect Lite X6.pkg” -target /


Thank you.
Is it possible that the editor you are using to create the script is using "smartquotes" instead of regular double quotes, and so it's not treating the quoted material as a single parameter?

Try getting rid of the quotes and escaping the spaces with \ and see if that works. If it does, then make sure you're using a plain old text editor that won't mess with your quotes.