Shell Comments in Linux Programming

in this topic learn to how to put comments in under the shell script,for example c,c++ languages are used // asign comments.in linux shell scrip are used to put comments used # are both type of comments single line and multiple line comments in linux.

Single Line Comments

single line comments in linux used # sign in linux the following example of single line comments.


$vi script1.sh
echo "This is Comments Example"
#above echo command print This is Comments Example in Output
$sh script.sh
							 

Multiple Line Comments

\

In linux both comments are same symbols are used like # the following example of multi line comments


$vi script1.sh
echo "This is Comments Example"
#Line 1
#Line 2
#Line 3
#Line 4
$sh script.sh
							 
Share Share on Facebook Share on Twitter Share on LinkedIn Pin on Pinterest Share on Stumbleupon Share on Tumblr Share on Reddit Share on Diggit

You may also like this!