Differences between revisions 2 and 5 (spanning 3 versions)
Revision 2 as of 2002-05-28 12:01:50
Size: 364
Editor: SimonHuggins
Comment:
Revision 5 as of 2008-02-19 15:39:23
Size: 364
Editor: localhost
Comment: converted to 1.6 markup
No differences found!

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)