Sed -- deleting to line BEFORE regexp match

Stainless Steel Gerbil [Joe Beckenbach] jerbil at cit-vax.Caltech.Edu
Fri Feb 24 05:20:09 AEST 1989


In his article Robert Lupton (lupton at uhccux.uhcc.hawaii.edu) writes:
>I have a patch generator (a script using diff -c, of course), and I want
>to exclude the patches for certain files. So I want to delete all lines
>from 
>
>diff -c -r old_file new_file
>...
>diff -c -r OLD_FILE NEW_FILE
>
>(but keeping the second diff line), using sed. 

	Can you spare an extra pass on it? If so, just duplicate the
last line and then delete from the first to the second inclusive.

<inews fodder>
<inews fodder>
<inews fodder>
<inews fodder>
<inews fodder>
<inews fodder>
<inews fodder>
-- 
Users I'd like to see:	[-:		| Joe Beckenbach
	Postmaster at link.L5.edu		| jerbil at cit-vax.caltech.edu
	gorby at cparty.kremlin.gov.cccp	| Caltech 256-80, Pasadena CA 91125



More information about the Comp.unix.questions mailing list