[alt.religion.computers] An AWK script to check "junk" for newsgroups

tchrist@convex.COM (Tom Christiansen) (02/27/91)

From the keyboard of Sepp@ppcger.ppc.sub.org (Josef Wolf):
:lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) writes:
:] (Josef Wolf) writes:
:] : Well. Fine fine. But what about using standard-tools? Which *IX is
:] : _delivered_ with Perl?
:
:] Convex's OS.  BSD 4.4 will have it.  It's included with GNU.  Eventually
:] everyone will include it, I suspect.
:
:C'mon! Get your feet back on earth. I'm sure there are _some_ people out
:in net.lands who don't want to buy a new OS just to get the fun of Perl.

Nor do they need to: it's free.

:] : Now here is my version of NEWJUNK. It could have been better, but older
:] : versions of gawk have these ugly memory-leak, so you have to sort out
:] : the 'Newsgroups:' lines and pipe it into gawk :-(
:
:] Well. Fine fine. But what about using standard-tools? Which *IX is
:] _delivered_ with gawk?  :-)
:
:Why don't you use awk ? ;-)

Because it doesn't work for your example.


:] : The awk-version will most likely be slower than the C-version and the
:] : Perl-Version, but it schould run on most *IX with little modifications.
:                                                      ^^^^^^
:
:] Right.
:] On my Vax:
:] $ awk -f newjunk.awk
:[ some error messages deleted ]
:
:Well, I said 'with _little_ modifications'. Not 'without modifications'...
:
:] On my Sun:
:
:] $ nawk -f newjunk.awk
:] nawk: empty regular expression
:]  source line number 51
:]  context is
:]          >>> // <<<  {
:
:
:Waht about this one:
:/.*/    {
:
:] Your "standard" tools ain't so standard.   :-(
:
:But much more standard than Perl.

I can't see how you can say possibly this when you've just clearly
demonstrated how truly incompatible supposedly standard utilities are.
In fact, you didn't find one single delivered awk that ran your code.
You used gawk.

Fine, you say, you'll just standardize on gawk, so you run out and get
it, compile it and install it on all the machines and continue on your
way coding your script.  Until you find the next missing or otherwise
incompatible utility.  If you're lucky, there's some free, fully
functional, non-buggy, and well-documented code out there that you can
go and get once again and install everywhere.  You do this again and
again and again.

Or you can just do it once.  There is but one Perl, while the awks of the
world are legion.  And since there are myriads of these individual tools
across scores of platforms, you've got scores of myriads of legions of
these darn things to muck with.  No thank you.

--tom
--
"UNIX was not designed to stop you from doing stupid things, because
 that would also stop you from doing clever things." -- Doug Gwyn

 Tom Christiansen                tchrist@convex.com      convex!tchrist