Good afternoon, I have a question about a script I am having problems with. I did something similar a couple of years ago and based this on that (which was on a different server). I need to run the script from a directory that has a number of directories in it and for each directory have it create a directory and change it's ownership. The script is:
#!/bin/bash for DIR in *; do mkdir $DIR/photos2; chown apache:apache $DIR/photos2; chmod 777 $DIR/photos2; done
When trying to run I get - syntax error near unexpected token `do'
I'm sure it is something silly I'm missing, any help would be appreciated.