[gnu.utils.bug] Gawk 2.10 getline is broken

mackenzi@thor.acc.stolaf.edu (David MacKenzie) (04/16/89)

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