Xref: utzoo comp.editors:682 comp.unix.questions:12831 Path: 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 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