Sed question

Chris Torek chris at mimsy.UUCP
Thu Jan 1 23:32:42 AEST 1987


I must have missed the original article, but the goal appears to
be to get `sed' to add a line of text after the first occurrence
of some particular pattern (here `^150'), but only the very first.
It is not difficult:

	% cat foo.sed
	:notyet
	/^150/{a\
	some\
	new\
	text
	b copy
	}
	n
	b notyet
	:copy
	n
	b copy
	% sed -f foo.sed
	...
-- 
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7690)
UUCP:	seismo!mimsy!chris	ARPA/CSNet:	chris at mimsy.umd.edu



More information about the Comp.unix.wizards mailing list