NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: standards/44063: awk: setting NF doesn't affect $<fieldnum>



The following reply was made to PR standards/44063; it has been noted by GNATS.

From: Robert Elz <kre%munnari.OZ.AU@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: 
Subject: Re: standards/44063: awk: setting NF doesn't affect $<fieldnum>
Date: Mon, 08 Nov 2010 17:06:34 +0700

     Date:        Sun,  7 Nov 2010 20:25:00 +0000 (UTC)
     From:        cheusov%tut.by@localhost
     Message-ID:  <20101107202501.0146A63BAC6%www.NetBSD.org@localhost>
 
   | http://www.opengroup.org/onlinepubs/009695399/utilities/awk.html
   | 
   |     ...
   |     References to nonexistent fields (that is, fields after $NF),
   |     shall evaluate to the uninitialized value.
   | 
 
 I think you might be reading more in to that than what it is actually
 intended to say - I'd suspect that if changing NF explicitly was meant
 to be supported at all, that doc would say something about its effects,
 
 It does say how NF can be set (including how it can be incremented if
 a previously non-existent field is assigned to), but it says nothing about
 the effects of increasing or decreasing the value of NF using an
 explicit assignment.
 
 That is, I see nothing to support the assertion that a field should become
 unassigned (nonexistant) merely because NF is altered.  I certainly don't
 think that that parenthetical remark can be used as justification for
 that interpretation - I'd interpret that as just saying that when a getline()
 happens, fields after the value NF gets set to are non-existent, and
 evaluate as uninitialised (not whatever value they may have had from
 an earlier line for example).
 
 kre
 


Home | Main Index | Thread Index | Old Index