I would like to comment a line 2 in abc.c
and add the text New second line
in line 3 of the file.
abc.c
:
First line
Second line
Third line
My modified file should look like
First line
//Second line
New second line
Third line
I have tried using the command
sed 's/Second line/\/\/Second line\
New second line/g' abc.c > tmp.c && mv tmp.c abc.c
But it gives the error as "sed command garbled" on sunOS 5.10
Can anyone please tell me what's the correct command to use?