Re^2: SED Question

Maarten Litmaath maart at cs.vu.nl
Thu Apr 13 07:03:59 AEST 1989


jgrace at bbn.com (Joe Grace) writes:
\...
\Yes, there is a way to get sed to do this, but you have to be
\wary of sed's shortcomings.

[shell script workaround deleted]

\If sed had a way of handling an EOF without quitting, the
\[workaround would be unnecessary] [...]

My first sed attempt can easily be fixed to handle partial matches at EOF
properly:

sed -n '
        /^PROMPT>$/{
		$p
                h
                n
                H
                /^>$/{
			$b eof
                        n
                        /^<$/b
                        H
                }
		: eof
                g
        }
        p
'
-- 
 "If it isn't aesthetically pleasing, |Maarten Litmaath @ VU Amsterdam:
  it's probably wrong." (jim at bilpin). |maart at cs.vu.nl, mcvax!botter!maart



More information about the Comp.unix.questions mailing list