Path: utzoo!utgpu!watmath!uunet!tut.cis.ohio-state.edu!AI.MIT.EDU!rms From: rms@AI.MIT.EDU Newsgroups: gnu.utils.bug Subject: [olender@rachmaninov.cs.colostate.edu: Bug in Gawk 2.10 Beta] Message-ID: <8905102051.AA00281@sugar-bombs.ai.mit.edu> Date: 10 May 89 20:51:03 GMT Sender: daemon@tut.cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 38 Return-Path: Date: Tue, 9 May 89 21:33:41 MDT X-Mailer: Mail User's Shell (6.5 4/17/89) From: olender@rachmaninov.cs.colostate.edu (Kurt Olender) To: bug-gnu-emacs@prep.ai.mit.edu Subject: Bug in Gawk 2.10 Beta 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 |