Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!bbn!bbn.com!jgrace From: jgrace@bbn.com (Joe Grace) Newsgroups: comp.editors Subject: Re: SED Question Keywords: sed Message-ID: <38585@bbn.COM> Date: 12 Apr 89 17:03:25 GMT References: <2360001@hpcuhc.HP.COM> <38564@bbn.COM> <10191@megaron.arizona.edu> Sender: news@bbn.COM Reply-To: jgrace@porter-square.BBN.COM (Joe Grace) Organization: Bolt Beranek and Newman Inc., Cambridge MA Lines: 13 John is definitely right about the "$" and bugs, even his sed style is better (Thanks!). But I just thought about another way you *could* do it using the (new :-) "$" feature assuming your sed hold buffer is big enough (likely, it won't be :-( :-( :-(). But this script is the simplest so far, so... sed -n -e 'H;${;x;s@^\(.\)\(.*\)@\2\1@;s@PROMPT>\n>\n<\n@@g;s@\n$@@;p;}' = Joe = Joe Grace ARPA: jgrace@bbn.com UUCP: {harvard,husc6,decvax,etc.}!bbn!jgrace