Welcome to WebmasterWorld Guest from 22.214.171.124
Forum Moderators: bakedjake
Here's my script:
for user in $(ls /Users)
if [ "$user" != 'administrator' ] ; then
sudo cp -rf /Users/gpillsbu/Library/Preferences/com.apple.dock.plist /Users/$user/Library/Preferences/com.apple.dock.plist
sudo chown -hR $user /Users/$user/Library/Preferences/com.apple.dock.plist
Here's the error:
./Update User Dock.sh: line 7: syntax error near unexpected token `if'
./Update User Dock.sh: line 7: `if [ "$user" != 'administrator' ] ; then'
I've tried several different syntax things like removing the quotes around $user, putting the 'then' statement on its own line, retyping the whole thing, etc.
What is an "unexpected token"?
FWIW, the script has worked fine before I tried to add the conditional.
Any help is appreciated!