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: Alexander Nasonov <alnsn%yandex.ru@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: standards-manager%netbsd.org@localhost, gnats-admin%netbsd.org@localhost,
        netbsd-bugs%netbsd.org@localhost
Subject: Re: standards/44063: awk: setting NF doesn't affect $<fieldnum>
Date: Mon, 8 Nov 2010 21:31:31 +0000

 cheusov%tut.by@localhost wrote:
 > http://www.opengroup.org/onlinepubs/009695399/utilities/awk.html
 > 
 >     ...
 >     References to nonexistent fields (that is, fields after $NF),
 >     shall evaluate to the uninitialized value.
 > 
 > Now awk works like the following
 > 
 >     $ echo ' 1  2  3 ' | awk.orig '{NF=2; print "`" $3 "`"}'
 >     `3`
 >     $ echo ' 1  2  3 ' | awk.orig '{NF=2; print "`" $0 "`"}' 
 >     ` 1  2  3 `
 >     $
 > 
 Hi guys,
 Can we add an atf test for this change (and the test from bin/42320
 as well)?
 Thanks,
 Alex
 


Home | Main Index | Thread Index | Old Index