Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!dali.cs.montana.edu!uakari.primate.wisc.edu!sdd.hp.com!spool.mu.edu!snorkelwacker.mit.edu!bloom-beacon!eru!hagbard!sunic!mcsun!hp4nl!charon!dik From: dik@cwi.nl (Dik T. Winter) Newsgroups: comp.unix.wizards Subject: Re: inserting CR/LF Message-ID: <3561@charon.cwi.nl> Date: 18 May 91 00:19:10 GMT References: <1060@dri500.dri.nl> Sender: news@cwi.nl Organization: CWI, Amsterdam Lines: 16 In article <1060@dri500.dri.nl> slootman@dri.nl (Paul Slootman) writes: > img@eng.cam.ac.uk (Ian Green) writes: > >I want to replace all occurences of LF in a file with the > >sequence CR-LF. > Use this: > sed `echo 's,$,\r,'` < input > output The SysV solution. Not all echo's interpret \r. Portable (I think): output If your system + shell allow quoting through ^V: output (here ^V is ctrl-v, ^M is ctrl-m or return). BSD and BSD derived systems do allow ^V quoting in general, but not with all shells. A notable exception is the Korn shell. How do I quote a return in the Korn shell? -- dik t. winter, cwi, amsterdam, nederland dik@cwi.nl