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 at chem.ucsd.edu jwpierce at ucsd +1 619 534 0203