🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.utils.bug
Article #1567

Gawk 2.10 getline is broken

#1567
From: David MacKenzie
Date: Sun, 16 Apr 1989 04:22
17 lines
826 bytes
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.

David MacKenzie
mackenzi@thor.stolaf.edu
Technical Details
Message-ID: <1860@thor.acc.stolaf.edu>
Path: arc1-ca.pugleaf.net!utzoo!dptcdc!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!srcsip!nic.MR.NET!thor.acc.stolaf.edu!mackenzi

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!dptcdc!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!srcsip!nic.MR.NET!thor.acc.stolaf.edu!mackenzi
From: mackenzi@thor.acc.stolaf.edu (David MacKenzie)
Newsgroups: gnu.utils.bug
Subject: Gawk 2.10 getline is broken
Message-ID: <1860@thor.acc.stolaf.edu>
Date: 16 Apr 89 04:22:04 GMT
Reply-To: mackenzi@thor.stolaf.edu (David MacKenzie)
Distribution: na
Organization: Environmental Defense Fund
Lines: 17