changing a ! to a \nC where \n is a newline

Sean Sheridan Coleman X5672 coleman at cam.nist.gov
Tue Sep 18 08:20:02 AEST 1990


I am trying to use the global substitution power in vi to 
replace every occurrence of ! with a newline and a C (\nC)

I have tried the following things:

g/;/s//\\nC/g   places the string \\nC where the ; is not a
newline.

g/;/s//\nC/g -- places a nC where the ; is.

Do you know how to make get vi to put a newline not a \n 
when doing the substitution?

How about the reverse, replace a newline with a character?


Sean Coleman
NIST
coleman at bldrdoc.gov



More information about the Comp.unix.shell mailing list