🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by rms Wed, 10 May 1989 20:51
[olender@rachmaninov.cs.colostate.edu: Bug in Gawk 2.10 Beta]
#1597
Author: rms
Date: Wed, 10 May 1989 20:51
38 lines
1383 bytes
Return-Path: <olender@rachmaninov.cs.colostate.edu>
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 |
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads