[comp.unix.shell] sed newlines

acmfiu@serss0.fiu.edu (ACMFIU) (01/23/91)

in a sed replacement expression, how can i insert a newline character?

albert

hansm@cs.kun.nl (Hans Mulder) (01/24/91)

In article <2056@kluge.fiu.edu> acmfiu@serss0.fiu.edu (ACMFIU) asks:
>in a sed replacement expression, how can i insert a newline character?

Bourne shell and derivatives:

sed 's/foo/bar\
bletch/'

C shell and derivatives:

sed 's/foo/bar\\
bletch/'

This is on a Sun3 running SunOS 4.1.1 if it matters.


Have a nice day,

Hans Mulder	hansm@cs.kun.nl