Welcome to WebmasterWorld Guest from 220.127.116.11
I have a set of standard scripts I use in all my sites, same folders, same names every time.
How would I write a simple shell script (.sh) to chmod perms on these.
directory "Big" needs to be set to 777
index.pl needs to be 755,
booger1.pl needs to be 766
booger2.pl needs to be 755
and then folder "Hairy" inside folder "Big" needs to be 777
Then another folder "Ziggy Stardust" and everything below it needs to be 755.
So, your script would look something like this:
chmod 755 foo1.pl
chmod 666 foo2.pl
chmod -R 755 "Ziggy Stardust"
the -R on the last command makes the chmod recursive ie it'll change the perms on everything below that directory. (On some flavours of unix it'll be -r instead)
Of course, whether your host will give you access to bash is another matter ;)
I was messing with it last nite and just went ahead and listed each and every line out and it worked.
DataPipe seems to be a pretty good host. I can also run cron too. Which brings me to the next question...is there a way to work a cron tab into that routine as well?
PS I ran mine without the shebang...is that ok?