Tuesday, May 15, 2007

Commenting Multiple lines in a shell script

By using anonymous here document, we can comment multiple lines in a shell script for debugging purposes.

eg:

: << COMMENT
echo "Not in the Scope of debugging/execution"
a=5
b=3
let c=a+b
echo $c
COMMENT

The statements in between the anonymous here document will not be executed.