🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.utils.bug
Article #1571

gawk bug not a bug

#1571
From: Arnold D. Robbins
Date: Mon, 24 Apr 1989 18:25
37 lines
1497 bytes
Just to "unsully" our reputation a little bit... :-)

--- Forwarded mail from cs.dal.ca!david

>From cs.dal.ca!david Mon Apr 24 14:12:23 1989
To: mackenzi@thor.acc.stolaf.edu (David MacKenzie)
Cc: arnold@emoryu1.UUCP (Arnold D. Robbins)
Subject: Re: from gnu bugs, #1 
In-Reply-To: Your message of Mon, 17 Apr 89 17:56:54 EDT.
             <8904172156.AA02810@emoryu1.cc.emory.edu> 
Date: Mon, 24 Apr 89 10:48:52 AST
From: cs.dal.ca!david


In your message of Mon, 17 Apr 89 17:56:54 EDT you write:

> Subject: Gawk 2.10 getline is broken
> 
> Run the following script:
> 
> #!/bin/sh
> gawk '
> BEGIN {
>   while (getline < "'$0'" > 0)
>     printf("FNR=%s, NR=%s, NF=%s, line=%s\n", FNR, NR, NF, $0)
>   exit
> }'
> 
> According to page 61 of the AWK Programming Language, getline has the side
> effects of setting NR, FNR, and (if no variable argument is given) NF.
> Gawk 2.10 beta sets only NF.

But on page 62 you will find that if the getline input is redirected from
a file, then FNR and NR are untouched.


--- End of forwarded message from cs.dal.ca!david
Technical Details
Message-ID: <8904241825.AA03518@emoryu1.cc.emory.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!unix.cc.emory.edu!arnold

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!unix.cc.emory.edu!arnold
From: arnold@unix.cc.emory.edu (Arnold D. Robbins)
Newsgroups: gnu.utils.bug
Subject: gawk bug not a bug
Message-ID: <8904241825.AA03518@emoryu1.cc.emory.edu>
Date: 24 Apr 89 18:25:39 GMT
Sender: daemon@tut.cis.ohio-state.edu
Distribution: gnu
Organization: GNUs Not Usenet
Lines: 37