Blank trimmer
Maarten Litmaath
maart at cs.vu.nl
Tue Aug 29 08:49:05 AEST 1989
tneff at 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 at cs.vu.nl, mcvax!botter!maart
More information about the Alt.sources
mailing list