easy for some

Tom Christiansen tchrist at convex.COM
Fri May 10 04:54:00 AEST 1991


>From the keyboard of lewis at tramp.Colorado.EDU (LEWIS WILLIAM M JR):
:In article <574 at appserv.Eng.Sun.COM> lm at slovax.Eng.Sun.COM (Larry McVoy) writes:
:>matthew at gizmo.UK.Sun.COM (Matthew Buller - Sun EHQ - MIS) writes:
:>> problem: to extract text between start and end patterns in a file
:... more problem description
:>/bin/sh, usage shellscript start_pat stop_pat [files...]
:>
:... complex shell and perl programs to do
:
:	sed -n '/pattern1/,/pattern2/p' source_file > new_file

nope -- you included the endpoints.

i didn't see the original posting, so i don't know whether it's
possibly to have multiple sets of /pat1/,/pat2/ areas
in the file.  if so, the 1,/pat1/d /pat2,$d posting i just
saw won't work.

followups have been redirected.  this isn't particularly wizardly.

--tom
--
Tom Christiansen		tchrist at convex.com	convex!tchrist
		"So much mail, so little time." 



More information about the Comp.unix.wizards mailing list