I have a dockutil script that works great, but when I try to add a line for a parameter it gets kind of funky.
Currently the script is written as:
ConUser=`/bin/ls -l /dev/console | awk '//{print $3 }'`
#Remove All Dock Items
sudo -u $ConUser dockutil --remove all --no-restart
#Add Dock Items
sudo -u $ConUser dockutil --add /Applications/Safari.app
sudo -u $ConUser dockutil --add /Applications/Google Chrome.app
sudo -u $ConUser dockutil --add /Applications/iPhoto.app
sudo -u $ConUser dockutil --add /Applications/Microsoft Office 2011/Microsoft Word.app
sudo -u $ConUser dockutil --add /Applications/Microsoft Office 2011/Microsoft Excel.app
sudo -u $ConUser dockutil --add /Applications/Microsoft Office 2011/Microsoft PowerPoint.app
sudo -u $ConUser dockutil --add /Applications/Dictionary.app
sudo -u $ConUser dockutil --add /Applications/Calculator.app
sudo -u $ConUser dockutil --add $4
In the dock policy I have added a parameter ($4) in this case that is:
/Applications/Google Earth.app
I have escaped the space as well as tried using quotes, but the script still ends up failing. I tried removing the space from the application on the client and then also removing the space from the parameter and the icon is then added.
So my question is why the space is being ignored? What the script is only seeing when the space is there is "Earth.app" and tries to look for it as a home directory or plist.
The error I get from the log:
Script exit code: 1 Script result: Earth.app' does not seem to be a home directory or a dock plist
My end goal here is to allow our field techs to have a predefined dock and they can add additional dock items specific to their schools via the parameter option.