Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
I am kind of a newbie to UNIX... how do you execute shell scripts? I created a new file called test and copied the script from a website. I tried fiddling around with chmod (chmod +rwx test) command, but the script does not run at all. I know I have to do something with chmod command to make the script executable. can anyone help? thanx.

High, you shouldn´t call your script test, because there is a unix command called test. Rename yout script by using the following command: mv

There are 2 ways
$chmod +x
$./#if the file is in current dir .
2
$ shYou can refer to following link for more on shell programming
http://www.adminschoice.com -> unix

Before using a file as a shell script you must change its access permissions so that you have execute permission on the file, otherwise the error message Permission deniedis displayed.
To run the shell script, simply type its name at the prompt. The commands in the script will then execute one at a time as though you were typing them in at the terminal.
To give yourself execute permission for the file containing the script use the command:
chmod u+rwx filename
The +rwx after the u allows you to read, write to and execute the script: no one else has permission to read, write or execute.
To give other users permission to read and execute but not alter the shell script use:
chmod go+rx filename
Regards,
Sherkock.

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |