An AWK script to check "junk" for newsgroups

Larry Wall lwall at jpl-devvax.JPL.NASA.GOV
Fri Feb 22 11:31:04 AEST 1991


In article <u4+nMD at ppcger.ppc.sub.org> Sepp at ppcger.ppc.sub.org (Josef Wolf) writes:
: dglo at 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?

Convex's OS.  BSD 4.4 will have it.  It's included with GNU.  Eventually
everyone will include it, I suspect.

: 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?  :-)

: 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
awk -f newjunk
awk: syntax error near line 6
awk: illegal statement near line 6
awk: syntax error near line 11
awk: illegal statement near line 11
awk: syntax error near line 12
awk: illegal statement near line 12
awk: syntax error near line 15
awk: illegal statement near line 15
awk: syntax error near line 16
awk: illegal statement near line 16
awk: syntax error near line 19
awk: illegal statement near line 19
awk: syntax error near line 20
awk: illegal statement near line 20
awk: syntax error near line 27
awk: bailing out near line 27

On my Sun:

$ nawk -f newjunk.awk
nawk: empty regular expression
 source line number 51
 context is
         >>> // <<<  {


Your "standard" tools ain't so standard.   :-(

Larry



More information about the Alt.sources mailing list