Differences between revisions 1 and 2
Revision 1 as of 2002-04-03 10:54:58
Size: 356
Editor: anonymous
Comment: missing edit-log entry for this revision
Revision 2 as of 2002-05-28 12:01:50
Size: 364
Editor: SimonHuggins
Comment:
Deletions are marked like this. Additions are marked like this.
Line 2: Line 2:

CategoryComputingTips > SedCompTips
Line 17: Line 20:


----
CategoryComputingTips

CategoryComputingTips > SedCompTips

Sed Tips

Insert a newline with sed

You have to escape the newline itself. Putting \n in the replacement side just won't work but you probably found that out already :)

sed -e 's/foo/f\
o/'
foo
f
o

Perl can do the same thing with perl -pe 's/foo/f\no/'

TheEarthWiki: SedCompTips (last edited 2008-02-19 15:39:23 by localhost)