outcomment bulk

Hello chiefs,

So i wanna outcomment several lines, but i dont want to start each line with #-sign. Once i saw it in use, but dont remember the syntax. It should work with sh or ksh.

regards
congo

:<<"COMMENT"
a line of code
a line of code
a line of code
COMMENT

well that works - yet what i saw once was even simpler, something like opening with #/' and closing with something like '/ -yet i cant remember the syntax, and cant remember where i saw it.

Do you/anyone know that kind of multible line outcommenting?

You can use sed to comment out serveral line but you need to know the line nos.

sed '1,3 s/^/# /g' your_file

where this command will comment out the lines 1-3 and you have to redirect your output to a new file.

Example

sed 'start_lineno,end_lineno s/^/# /g' your_file > new_file