[alt.sources.d] An AWK script to check "junk" for newsgroups

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

From the keyboard of Sepp@ppcger.ppc.sub.org (Josef Wolf):
:dglo@ADS.COM (Dave Glowacki) writes:
:
:] Since, as a rule, EVERY C or shell program posted must be followed up
:] by a PERL script, here's my version of NEWJUNK.
:
:Well. Fine fine. But what about using standard-tools? Which *IX is
:_delivered_ with Perl?

The one shipped by CONVEX Computer Corporation, of course.  Call it 
competetive advantage.  :-)

If your vendor doesn't supply perl (and fie on them for not doing so),
then it's trivial to get.  Of course, gawk is equally easy to get.

What systems are _delivered_ with nawk?  I don't see why you think a gawk
program has something over a perl one; it's certainly slower.   If your
point is delivered systems, then nawk/gawk scripts aren't the answer.

--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

ronald@robobar.co.uk (Ronald S H Khoo) (02/23/91)

tchrist@convex.COM (Tom Christiansen) writes:

> What systems are _delivered_ with nawk?

Only the most ubiquitous of unices:  SCO Xenix, of course.  So if you
count delivered systems by number of licenses, nawk has a surprisingly
large lead.  Most people with SCO Xenix don't realise this though, cos
its nawk is called "awk" and there ain't no "oawk" on the system.

-- 
Ronald Khoo <ronald@robobar.co.uk> +44 81 991 1142 (O) +44 71 229 7741 (H)

Sepp@ppcger.ppc.sub.org (Josef Wolf) (02/25/91)

tchrist@convex.COM (Tom Christiansen) writes:

] What systems are _delivered_ with nawk?  I don't see why you think a gawk
] program has something over a perl one; it's certainly slower.   If your
] point is delivered systems, then nawk/gawk scripts aren't the answer.

Well, but what about awk? Isn't it more standard than perl?

Greetings...


| Josef Wolf, Germersheim, Germany | +49 7274 8047  -24 Hours- (call me :-)
| ...!ira.uka.de!smurf!ppcger!sepp | +49 7274 8048  -24 Hours-
|     sepp@ppcger.ppc.sub.org      | +49 7274 8967  18:00-8:00, Sa + Su 24h
|  "is there anybody out there?"   | all lines 300/1200/2400 bps 8n1

prc@erbe.se (Robert Claeson) (02/25/91)

In article <1991Feb22.011415.21895@convex.com> tchrist@convex.COM (Tom Christiansen) writes:

>What systems are _delivered_ with nawk?

What systems aren't? Oh, the ones running SVR4 of course. awk is nawk there,
and old awk is oawk.

-- 
Robert Claeson

Disclaimer: I represent myself and not my employer.

tmanos@wyvern.uucp (Tom Manos) (02/27/91)

ronald@robobar.co.uk (Ronald S H Khoo) writes:
>tchrist@convex.COM (Tom Christiansen) writes:
>> What systems are _delivered_ with nawk?
>Only the most ubiquitous of unices:  SCO Xenix, of course.

Also Microport SysVr3.2.2

Tom
-- 
Tom Manos @ wyvern     Norfolk, VA

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