[comp.unix.questions] Re^2: Sed -- deleting to line BEFORE regexp match

maart@cs.vu.nl (Maarten Litmaath) (02/23/89)

leo@philmds.UUCP (Leo de Wit) writes:
\sed "
\/^diff/{
\    : again
\    /new_file1$/b del
\    /new_file2$/b del
\
\       (etc.)
\
\    /new_fileN$/b del
\    b nodel
\    : del
\    n
     ^
     questionable

\    /^diff/b again
\    b del
\    : nodel
\}"

Huh? From `man sed':

     (2)n Copy the pattern space to the standard output.  Replace
          the pattern space with the next line of input.

You don't want the pattern space on the standard output. My previous article
showed a solution using sed's `-n' option.
-- 
 "Those who do not understand Henry     |Maarten Litmaath @ VU Amsterdam:
Spencer are condemned to reinvent DOS." |maart@cs.vu.nl, mcvax!botter!maart