🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.editors
Article #3539

Re^2: SED Question

#3539
From: Maarten Litmaath
Date: Wed, 12 Apr 1989 21:03
33 lines
1275 bytes
jgrace@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@bilpin). |maart@cs.vu.nl, mcvax!botter!maart
Technical Details
Message-ID: <2292@solo11.cs.vu.nl>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!lll-winken!uunet!mcvax!hp4nl!botter!star.cs.vu.nl!maart
References: <2360001@hpcuhc.HP.COM> <38564@bbn.COM>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!lll-winken!uunet!mcvax!hp4nl!botter!star.cs.vu.nl!maart
From: maart@cs.vu.nl (Maarten Litmaath)
Newsgroups: comp.editors,comp.unix.questions
Subject: Re^2: SED Question
Keywords: sed, improvement, fix
Message-ID: <2292@solo11.cs.vu.nl>
Date: 12 Apr 89 21:03:59 GMT
References: <2360001@hpcuhc.HP.COM> <38564@bbn.COM>
Organization: V.U. Informatica, Amsterdam, the Netherlands
Lines: 33