Xref: utzoo comp.editors:685 comp.unix.questions:12867 Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!lll-winken!uunet!mcvax!hp4nl!philmds!leo From: leo@philmds.UUCP (Leo de Wit) Newsgroups: comp.editors,comp.unix.questions Subject: Re: Re^2: SED Question Keywords: sed, improvement, fix Message-ID: <1003@philmds.UUCP> Date: 13 Apr 89 22:00:08 GMT References: <2360001@hpcuhc.HP.COM> <38564@bbn.COM> <2292@solo11.cs.vu.nl> Reply-To: leo@philmds.UUCP (Leo de Wit) Organization: Philips I&E DTS Eindhoven Lines: 54 In article <2292@solo11.cs.vu.nl> maart@cs.vu.nl (Maarten Litmaath) writes: [] |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 |' I think you'll need a third attempt 8-). It still doesn't handle correct a series of lines like PROMPT> PROMPT> > < or one like PROMPT> > PROMPT> > < Alternative: sed -n ' : start $p $q N /^PROMPT>\n>\n<$/d /\n[^\n]*\n/{ P D } b start' Leo.