[comp.unix.questions] Printing lines between BEGIN and END

jwp@chem.ucsd.edu (John Pierce) (04/24/88)

awk '/^BEGIN$/,/^END$/ {if($1 !~ /^BEGIN$/ && $1 !~ /^END$/) print}' filename

sed -e '1,/^BEGIN$/d' -e '/^END$/,$d' filename

The sed script has the flaw that there must be at least one line preceding
the BEGIN line.

-- 
   John Pierce	Chemistry, B-032, UCSD, La Jolla,  CA 92093
		jwp@chem.ucsd.edu  jwpierce@ucsd  +1 619 534 0203