Linux and Networking

Linux and Networking

4.2. Adding comments to your shell script

Comments are generally written by putting a hash # before the comment. If your comment occupies two lines you will have to put two hash marks.

 

For example the following script:

 

#!/bin/bash

echo ‘Hello hello’ #this line shows something on the screen

#end script

 

When you run it, it will show the following on the screen:

 

$ ./script.sh

Hello hello

 

Proposed exercise.

Add comments to your shell script and check that it still works.

The Demeter Project