Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!mimsy!chris From: chris@mimsy.UUCP (Chris Torek) Newsgroups: comp.unix.wizards Subject: Re: Sed question Message-ID: <4898@mimsy.UUCP> Date: Thu, 1-Jan-87 08:32:42 EST Article-I.D.: mimsy.4898 Posted: Thu Jan 1 08:32:42 1987 Date-Received: Thu, 1-Jan-87 22:04:34 EST References: <107@dcl-csvax.comp.lancs.ac.uk> <140@piaget.UUCP> <4991@reed.UUCP> Organization: U of Maryland, Dept. of Computer Science, Coll. Pk., MD 20742 Lines: 23 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@mimsy.umd.edu