Shell script put multiple line comment
Q. I’d like to use multiline comments under shell script. Under C / C++ I can use format
/*
my c code
comment # 2
blah
*/
How do I put multi line comment under a shell script?
A. By default shell script can be commented out prefixing # character for example:
# my comment
For multilinecomment use
# my comment 1
# my comment 2
# my comment N
However you can use HERE DOCUMENT feature as follows:
#!/bin/bash
echo "Say Something"
<<COMMENT1
your comment 1
comment 2
blah
COMMENT1
echo "Do something else"
E-mail this to a friend
Printable version
Related Other Helpful FAQs:
- Linux add a user using command line tools
- Search Multiple Words / String Pattern Using grep Command
- Understanding Bash fork() bomb ~ :(){ :|:& };:
- Linux and UNIX view command-line history
- FreeBSD Install BASH Shell
Leave a Reply
We encourage your comments, and suggestions. But please stay on topic, be polite, and avoid spam. Thank you very much for stopping by our site!
Tags: Bash, multiline_comment, shell_add_comment, shell_script




Recent Comments
Yesterday ~ 3 Comments
09/06/2008 11:03 pm (2 days ago) ~ 12 Comments
09/06/2008 02:10 pm (2 days ago) ~ 7 Comments
09/06/2008 06:51 am (2 days ago) ~ 2 Comments
09/06/2008 01:28 am (2 days ago) ~ 3 Comments