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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

c++ comment

Status
Not open for further replies.

Nostradamus

Technical User
May 3, 2000
419
SE
Am I wrong if I say that everything between these to signs are ignored in, for example, a config file?

/*
/usr/bin/whatever
*/

I´ve been assigned to handle our dns-servers and the named.conf is loaded with these comments and I´m trying to tangle up this mess.

thanks in advance. /Sören
 
well, it's actually a bit easier to comprehend and far less confusing if you try to maintain them to a single line
if possible.....

for instance, it would be best (using your example above)
to have:

/* /usr/bin/whatever */

but, you are correct in thinking that the /* and */ are used to "uncomment" lines

hope that helps

scooter6
 
The line would be to long for that I´m afraid.

Now I´ll rip all info between /* and */ away, so that this config files are easy to handle.

Thank you scooter.

/Sören
 
I'd watch yourself if you do delete the info within the comments - they're sometimes there for a reason and could be needed in a given set of circumstances which you have yet to encounter.
 
Hi,
Define what you mean that the line would be too long?

Do you mean it WRAPS on your 80 column display?

Lines in scripts can typically be 4096 characters or more. If the line is longer than your window make your window wider.

VI typically can't hadle windows wider than 160 characters, however Emacs manages bigger windows than that.

Also given the title of this thread I am surprised you aren't using

// comment line 1
// comment line 2

since the // is the C++ comment delimiter except it is limited to a single line

For scripts like CSH and KSH the '#' is the comment
characters

# this is a comment.


With Configuration files comment delimiters can be whatever the programer has coded into the program reading the file to ignore.




 
DNS files use ; at start of comments.

I hope it works...
Unix was made by and for smart people.
 
hehe, I just wanted a yes or no answer when I started this thread.

KenCunningham: I did of course make a backup first.

ElgisRamon: Yes, but this is the named.conf and not the zone-files. In the db-files I use ; for comments.

tdatgod: I mainly (perhaps only) use vi and I don´t want the line to disappear out of sight.

The line would easily be more than 4096 characters long

The reason that // isn´t used is that you would have to type it in on every line you want gone. It´s easier to delete big chunks of text on several lines with /* and */ although it might not give you a good overview of which parts that´s ignored.

Regarding the topic I spelled it wrong and of course meant c-style comment which /* */ is. /Sören
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top