How to run shell scripts? - Shell

How to run shell scripts?

Snippet Code

Rate this page :
  [ 0 votes]

To run the shell script,follow the steps given below.,

1) Save the shell file with .sh (e.g. "") or, open the shell file using vim command to access the shell file in terminal. 2) Now, open the Terminal. 3) Change to the directory where you have saved your shell file. 4) Then, type chmod 0777 to make your file executable. 5) Type sh to execute the file. Basic Program for shell script, #!/bin/bash # My first script echo "Hello World!"


Ask Questions

Ask Question