arnold@unix.cc.emory.edu (Arnold D. Robbins) (04/25/89)
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