Path: utzoo!attcan!uunet!zephyr.ens.tek.com!uw-beaver!mit-eddie!bloom-beacon!eru!hagbard!sunic!mcsun!hp4nl!charon!dik From: dik@cwi.nl (Dik T. Winter) Newsgroups: comp.unix.shell Subject: Re: changing a ! to a \nC where \n is a newline Keywords: vi Message-ID: <2198@charon.cwi.nl> Date: 20 Sep 90 10:06:13 GMT References: <5015@alpha.cam.nist.gov> <1990Sep18.023649.1336@virtech.uucp> <2962@wyse.wyse.com> Sender: news@cwi.nl Organization: CWI, Amsterdam Lines: 11 In article <2962@wyse.wyse.com> bob@wyse.UUCP (Bob McGowen x4312 dept208) writes: > In article <1990Sep18.023649.1336@virtech.uucp> cpcahil@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/!/-VC/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@cwi.nl