Crash Course crowfly.net << >> Introduction GNU_Tools Example1 Example2 Execution_bit Bang_bin_bash Example3 The_dot Example4 Example5 Example6 Example7 Example8 Background Forking Example9 Bash_profile Pattern_match Regex Debug Gory_details References << >> | In order to run a script in Unix you need to set the execution bit: Say I just created the talk.sh script shown in Example 2. [email protected]> emacs talk.sh [email protected]>Note on Unix Text Editors: You can choose from vi, emacs, pico, or joe to name some of the common ones. This is one of every Unix newbie's great hurdle -- learning a new Text Editor.
[email protected]> ls -l talk.sh -rw-rw-r-- 1 dlink viddev 5 2006-07-20 13:10 talk.txt Now to set the execution bit: [email protected]> chmod a+x talk.sh [email protected]> ls -l talk.sh -rwxrwxr-x 1 dlink viddev 5 2006-07-20 13:10 talk.sh Meaning of the three x's:
Another way to set the execution bits, (which is cooler because it uses binary) is this: [email protected]> chmod 775 talk.sh [email protected]> ls -l talk.sh -rwxrwxr-x 1 dlink viddev 5 2006-07-20 13:10 talk.sh Finally we're good to go: [email protected]> ./talk.sh Hello dlink, Today is Thursday Today's date is 20-Jul-2006 And the time is 11:51:59 AM But what if I don't want to set the Execution bit? Fine, you would get this: [email protected]> ./talk.sh -bash: ./talk.sh: Permission denied ![]() |