deleting some empty lines with sed

Randal L. Schwartz merlyn at iwarp.intel.com
Mon Apr 29 15:40:20 AEST 1991


In article <1991Apr27.143519.26256 at daimi.aau.dk>, datpete at daimi (Peter Andersen) writes:
| Does anyone have a way of doing this, perhaps using something
| else but sed. I'm not a perl-guru, but if its possible in perl
| I'd like to hear about that too.

perl -ne 'print unless /\S/ ? ($skip = 0) : $skip++' <in >out

How this works is left as an exercise to the reader. :-)

print "Just another Perl hacker," unless $skip # :-)
-- 
/=Randal L. Schwartz, Stonehenge Consulting Services (503)777-0095 ==========\
| on contract to Intel's iWarp project, Beaverton, Oregon, USA, Sol III      |
| merlyn at iwarp.intel.com ...!any-MX-mailer-like-uunet!iwarp.intel.com!merlyn |
\=Cute Quote: "Intel: putting the 'backward' in 'backward compatible'..."====/



More information about the Comp.unix.shell mailing list