[Chicago-talk] Replacing consecutive newlines with a single newline

Randal L. Schwartz merlyn at stonehenge.com
Sat Sep 27 00:11:29 PDT 2008

>>>>> "Vijay" == Vijay Kumar <vjcang at gmail.com> writes:

Vijay>     perl -0777 -pi -e 's/^SQL>//mg; s/\n{2,}/\n\n/g' inputfile
Vijay>     cat inputfile | mailx ....

Why do people use a useless cat?

Why not just:

    cat inputfile | cat | cat | cat | cat | mailx ...

it's just about as wasteful?

Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn at stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.
See http://methodsandmessages.vox.com/ for Smalltalk and Seaside discussion

More information about the Chicago-talk mailing list