Writing a Shell Script

To successfully write a shell script, you have to do three things:

1.Write a script
2.Give the shell permission to execute it
3.Put it somewhere the shell can find it

Writing A Script

A shell script is a file that contains ASCII text. To create a shell script, just use a text editor. Here is an example of a simple Shell Script:

#!/bin/bash # means comment
# My first script # any text after a # is ignored. So these first 2 lines do nothing.
echo "Hello World!"