Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!wasatch!cs.utexas.edu!uunet!mcsun!hp4nl!botter!star.cs.vu.nl!maart From: maart@cs.vu.nl (Maarten Litmaath) Newsgroups: alt.sources Subject: Re: Blank trimmer Message-ID: <3086@solo6.cs.vu.nl> Date: 28 Aug 89 22:49:05 GMT References: <14602@bfmny0.UUCP> Organization: V.U. Informatica, Amsterdam, the Netherlands Lines: 27 tneff@bfmny0.UUCP (Tom Neff) writes: \This is one of those nasty hacks purists get on your case for because \you can do it all with sed(1). [...] Indeed! Heh heh heh... ----------8<----------8<----------8<----------8<----------8<---------- #!/bin/sh tab=" " SED=" s/[ $tab][ $tab]*$// /^$/{ p : gap n s/[ $tab][ $tab]*$// /^$/b gap } p " sed -n "$SED" ${1+"$@"} ----------8<----------8<----------8<----------8<----------8<---------- -- C, the programming language that's the same |Maarten Litmaath @ VU Amsterdam: in all reference frames. |maart@cs.vu.nl, mcvax!botter!maart