Path: utzoo!utgpu!watmath!clyde!bellcore!rutgers!apple!bionet!agate!ucbvax!hplabs!otter!pjh From: pjh@otter.hpl.hp.com (Patrick Hyland) Newsgroups: comp.unix.questions Subject: Re: one more SED/AWK question Message-ID: <1170010@otter.hpl.hp.com> Date: 8 Dec 88 13:47:34 GMT References: <1076@mtung.ATT.COM> Organization: Hewlett-Packard Laboratories, Bristol, UK. Lines: 14 The following will do what you want if you're using Bourne shell: sed -n -e ' /CZECH/{ : loop p n /PERU/!b loop } ' filename Thanks to Maarten Litmaath for posting the original suggestion from which this is derived. Patrick Hyland.