one more SED/AWK question

Patrick Hyland pjh at otter.hpl.hp.com
Thu Dec 8 23:47:34 AEST 1988


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.



More information about the Comp.unix.questions mailing list