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

Dik T. Winter dik at cwi.nl
Thu Sep 20 20:06:13 AEST 1990


In article <2962 at wyse.wyse.com> bob at wyse.UUCP (Bob McGowen x4312 dept208) writes:
 > In article <1990Sep18.023649.1336 at virtech.uucp> cpcahil at virtech.UUCP (Conor P. Cahill) writes:
 >     >>I am trying to use the global substitution power in vi to 
 >     >>replace every occurrence of ! with a newline and a C (\nC)
 >   >:1,$s/!/<ctrl>-V<Return>C/g	(this will appear as:1,$s/!/^MC/g)
 > This will put carriage returns in the file, not newlines.
Wrong.  It puts newlines (although ^M is carriage return).  Confusing isn't it?
(This is at least true for the versions of vi I have access to.)
--
dik t. winter, cwi, amsterdam, nederland
dik at cwi.nl



More information about the Comp.unix.shell mailing list