A little help with SED please - clarifications.

Shamim Pogner Mohamed sham at arizona.edu
Thu Apr 21 10:58:08 AEST 1988


In article <5490 at sigi.Colorado.EDU>, murillo at sigi.Colorado.EDU (Rodrigo Murillo) writes:

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

Here's a script that seems to work:  (to be run as: sed -n -e script)
-----------------------------------------------------------------------------
s/BEGIN//
t nums
b
: nums
n
s/END//
t
p
b nums
-----------------------------------------------------------------------------

I was going to e-mail but thought this solution is rather kludgy. Does 
someone have a nice elegant solution?

Yes, I know it can be done in awk etc.... 
-- 
Shamim Mohamed,  Dept. of Computer Science,
U of Arizona, Tucson AZ 85721  (602) 621-4891

{ihnp4,allegra,cmcl2...}!arizona!sham  |  sham at arizona.edu



More information about the Comp.unix.questions mailing list