
The script should have execute permissions for the correct owners in order to be runnable.
if you want to execute a shell file called foo.sh
you have to
chmod +x foo.sh
and then you have to execute it by typing
./foo.sh
Example :
here’s a shell file which will display “Hello World” upon successful execution.
#!/bin/bash echo "Hello, World!"
Save the above code into a file called hello.sh, then to run it you have to follow the below procedure
chmod +x hello.sh ./hello.sh
Output :
Hello, World!
{ 1 trackback }
{ 4 comments… read them below or add one }
Testing Gravatar
thanks dude..I was stuck at a shell scrip
now I can try many script that I have ! ..
>.<
Need more about shell scripting ….
Hi , thanks for comments ..
I will post some useful shell scripts in future posts..