Let's say you write a script to say "Hello World".
test.sh:
#!/bin/bashYou can execute this script by typing:
echo "Hello World"
exit 0
./test.shBut you get the following output:
-bash: ./test.sh: Permission deniedyou need to grant "execute" & "read" permissions for this script for yourself or for everyone. You can do this by typing:
chmod o+rx test.sh(this will give read & execute permissions to "Other" users)
chmod u+rx test.sh(this will give read & execute permissions to the current "User")
chmod uo+rx test.sh(this will give read & execute permissions to the current "User" & to "Other" users)
For further reading on mac bash scripting, and a comparison on Perl, Bash, & Applescript:
http://macdevcenter.com/pub/a/mac/2003/11/07/scripting_osx.html?page=3
No comments:
Post a Comment