386/ix V2.0.2 breaks awk

H Boothroyd bsrdp at warwick.ac.uk
Fri Sep 29 02:17:44 AEST 1989


In article <1456 at redsox.bsw.com> campbell at redsox.bsw.com (Larry
Campbell) writes:
> A few weeks ago, I upgraded my 386/ix system from 2.0.1 to 2.0.2, and one of
> my nightly news administration scripts broke.  The problem is caused by a
> bug in nawk, which in 2.0.2 seems to have become the standard awk.
[Example deleted]

A version of gawk gave me exactly the same problem here when I switched
a news script to it last week:
        Gnu Awk (gawk) 2.10 beta 07 Apr 1989
running on a Sun 4.

However, an earlier MSDOS version has no problems with parsing the compound
pattern:
        Gnu Awk (gawk) 2.02 beta (PC) 23 Dec 1988 .

>From the evidence of the experience of Larry and me, in such widely
different
contexts, my provisional conclusions are:
     * the parsing bug is a 1989 creation of awk/gawk programmers,
     * the defective code is being copied around the awk/gawk world.

Experiments show that the nearest to full generality that the 2.10
parser can manage with plain patterns of the form /regularexpression/
is:
        /re/ && .... && $0~/re/ && ...
in which
        all plain /re/ forms must come first and
        no parentheses can be used round plain /re/ forms.

Which is a far cry from the specification in the awk book!

There is a workaround. Turn all the patterns into the $0~/re/ form.
This seems to restore generality in the use of parentheses.

But it was an odd oversight to let this creep in. What sort of test
suites are used that don't check parsing?

And as end users are we, and our system administrators, unaware of upgrades
that correct this rather glaring fault?

-----------------------
Hylton Boothroyd        Janet: h.boothroyd at uk.ac.warwick.cu
Warwick Business School Darpa: h.boothroyd%cu.warwick.ac.uk at relay-nsfnet.ac.uk
University of Warwick   Uucp:  h.boothroyd%sol at warwick.uucp
COVENTRY                Earn/Bitnet: h.boothroyd%uk.ac.warwick.cu at UKACRL
England  CV4 7AL        Phone: +44 203 523523  Extension 2428
-----------------------



More information about the Comp.unix.i386 mailing list