Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

multiple line comment

Status
Not open for further replies.

sureshp

Programmer
Aug 28, 2000
79
0
0
Is there any way to make comment multiple lines .
For example if I want to have 10 lines description in Shell
script file I am commenting it with
#first line
#second line
#3 line
#....
#...
echo "regarding multiple comment"
**********

I want to comment it like C programming


/* first line
2 line
3 line
....
10th lin */
echo "r...."

Thanks in advance
 
You *may* be able to do this by escaping newline characters with a "\". For example:
[tt]
#!/bin/sh

# Here is the start of my multi-line comment And here is some more text.

Put program code here...
[/tt]
However, I would not do this. The convention in shell scripts is to start each and every comment line with "#". Another method that I have seen used occasionally is to use the ":" 'do nothing' shell command to prefix a comment line. This may be better for you. For example:
[tt]
#!/bin/sh

# **************************
: Here is a multi-line comment.
: This stands out a little better than
: just using "#" characters
: all the time
# ***************************

etc.
[/tt]

Hope this helps.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top