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. "test.sh") 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 test.sh to make your file executable. 5) Type sh test.sh to execute the file. Basic Program for shell script, #!/bin/bash # My first script echo "Hello World!"

Tags


Ask Questions

Ask Question