A little help with SED please - cla

Leslie Mikesell les at chinet.UUCP
Fri Apr 22 08:17:15 AEST 1988


>
>:I need an sed line (or some gory pipeline) to extract the data between
>                     ^^^^^^^^^^^^^^^^^^^^^^
>:BEGIN and END.

How about:
sed -n -e '/BEGIN/,/END/p' |sed -e '/BEGIN/d' -e '/END/d'

perhaps with ^BEGIN$ if you want to force matches to full lines or
changing the second sed to s/BEGIN// if you don't.

  Les Mikesell



More information about the Comp.unix.wizards mailing list