in reply to Re^3: how to run this script (permissions)
in thread how to run this script

chmod 777

Far too permissive!

That gives every man and his dog permission to run, modify or even delete the script, if they are able to browse to the directory containing it. Much safer would be

chmod u+x

We see, and have to try to fix, the chaos that ensues when someone does an ill-considered

chmod -R 777 /some/path/with_lots_of/sub-directories

and it is a practice strongly to be discouraged.