Article View: gnu.emacs.bug
Article #1675Bug in Gawk 2.10 Beta
From: Kurt Olender
Date: Wed, 10 May 1989 03:33
Date: Wed, 10 May 1989 03:33
31 lines
1168 bytes
1168 bytes
I have no other address for reporting bugs for gawk.
bug-gnu-gawk (my best guess) fails.
Please forward to the appropriate person.
I am using Gawk 2.10 Beta on a Sun 3/50 running SunOS 4.0
The following program works incorrectly under gawk, but correctly
under the awk provided with my system.
# Print a histogram from a file of data, one item per line
NR == 1 {imin = imax = $1}
{
value[$1] = value[$1] "*"
if (imin > $1) imin = $1
if (imax < $1) imax = $1
}
END { for(i=imin; i<=imax; i++) printf("%5d |%s\n",i,value[i]) }
gawk matches the first pattern, but never the (omitted) second, thus printing
out an incorrect histogram.
Example: with data file
90
80
70
gawk prints
90 |
Technical Details
Message-ID:
<8905100333.AA01921@rachmaninov.CS.ColoState.Edu>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!RACHMANINOV.CS.COLOSTATE.EDU!olenderShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!RACHMANINOV.CS.COLOSTATE.EDU!olender From: olender@RACHMANINOV.CS.COLOSTATE.EDU (Kurt Olender) Newsgroups: gnu.emacs.bug Subject: Bug in Gawk 2.10 Beta Message-ID: <8905100333.AA01921@rachmaninov.CS.ColoState.Edu> Date: 10 May 89 03:33:41 GMT Sender: daemon@tut.cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 31