chmod Command: Run Shell Script In Linux
Set an executable permission using the chmod command as follows:
[code]chmod +x file.sh[/code]
Now your can run your .sh file as follows:
Execute Shell Script Using . ./ (dot space dot slash)
[code]./file.sh[/code]
You can also execute a unix shell script by specifying the interpreter in the command line as shown below.
Execute using sh interpreter
[code]$ sh scriptfile[/code]
Execute using bash interpreter
[code]$ bash scriptfile[/code]