Steps to write and execute a script

  • Open the terminal. Go to the directory where you want to create your script.
  • Create a file with .sh extension.
  • Write the script in the file using an editor.
  • Make the script executable with command chmod +x <fileName>.
  • Run the script using ./<fileName>.

Note: In the last step you have to mention the path of the script if your script is in other directory.


Posted

in

by

Tags:

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *