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: Aleksey Cheusov <cheusov%tut.by@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, 08 Nov 2010 22:37:51 +0200

 >  So I think this is a good change regardless of whether the standard
 >  really demands it...
 >  
 >  I'd say there there is one open question, which is whether
 >  
 >     % echo 1 2 3 | awk '{ NF=2; NF=3; print; }'
 >  
 >  should print "1 2" or "1 2 3", IOW, whether assiging NF destroys or
 >  merely hides subsequent values. That one i could argue either way...
 
 GNU awk and mawk destroy them.  This is why
 I implemented assigning NF this way.
 
 -- 
 Best regards, Aleksey Cheusov.
 


Home | Main Index | Thread Index | Old Index