bash script Syntax error: word unexpected (expecting "do") bash script Syntax error: word unexpected (expecting "do") nginx nginx

bash script Syntax error: word unexpected (expecting "do")


Probably you managed to insert windows line endings when you copy and pasted. If you have dos2unix, use it. (dos2unix scriptfile) Otherwise, there are a number of similar utilities.


Why do you have

/home/$dbuser/.dropbox-dist/dropboxd

or replacing variables.

/home/root/.dropbox-dist/dropboxd

Shouldn't it be

/root/.dropbox-dist/dropboxd

eg

/$dbuser/.dropbox-dist/dropboxd

Are you seriously allowing dropboxes in /root ?

Also why a for dbuser in DROPBOX_USERS; do reassign? rather than

dbuser=$DROPBOX_USERS