A NOTE has been added to this issue. 
====================================================================== 
https://austingroupbugs.net/view.php?id=1820 
====================================================================== 
Reported By:                mortoneccc
Assigned To:                
====================================================================== 
Project:                    1003.1(2016/18)/Issue7+TC2
Issue ID:                   1820
Category:                   Shell and Utilities
Type:                       Enhancement Request
Severity:                   Comment
Priority:                   normal
Status:                     New
Name:                       Ed Morton 
Organization:                
User Reference:              
Section:                    awk 
Page Number:                0 
Line Number:                0 
Interp Status:              --- 
Final Accepted Text:         
====================================================================== 
Date Submitted:             2024-03-14 11:36 UTC
Last Modified:              2024-05-13 15:07 UTC
====================================================================== 
Summary:                    The impact of changing NF should be stated
====================================================================== 

---------------------------------------------------------------------- 
 (0006779) geoffclare (manager) - 2024-05-13 15:07
 https://austingroupbugs.net/view.php?id=1820#c6779 
---------------------------------------------------------------------- 
On Issue 8 draft 4.1 page 2613 line 85507, change:
<blockquote>Field variables shall be designated by a '$' followed by a
number or numerical expression. The effect of the field number
<i>expression</i> evaluating to anything other than a non-negative integer
is unspecified; uninitialized variables or string values need not be
converted to numeric values in this context. New field variables can be
created by assigning a value to them. References to nonexistent fields
(that is, fields after $<b>NF</b>), shall evaluate to the uninitialized
value. Such references shall not create new fields. However, assigning to a
nonexistent field (for example, $(<b>NF</b>+2)=5) shall increase the value
of <b>NF</b>; create any intervening fields with the uninitialized value;
and cause the value of $0 to be recomputed, with the fields being separated
by the value of <b>OFS</b>. Each field variable shall have a string value
or an uninitialized value when created. Field variables shall have the
uninitialized value when created from $0 using <b>FS</b> and the variable
does not contain any characters. If appropriate, the field variable shall
be considered a numeric string (see Expressions in awk, on page
2608).</blockquote>
to:
<blockquote>Field variables shall be designated by a '$' followed by a
number or numerical expression. The effect of the field number
<i>expression</i> evaluating to anything other than a non-negative integer
is unspecified; uninitialized variables or string values need not be
converted to numeric values in this context. Each field variable shall have
a string value or an uninitialized value when created. Field variables
shall have the uninitialized value when created from $0 using <b>FS</b> and
the variable does not contain any characters. If appropriate, the field
variable shall be considered a numeric string (see Expressions in awk, on
page 2608).

New field variables can be created by assigning a value to them. References
to nonexistent fields (that is, fields after $<b>NF</b>), shall evaluate to
the uninitialized value. Such references shall not create new fields.
However, assigning to a nonexistent field (for example, $(<b>NF</b>+2)=5)
shall increase the value of <b>NF</b>; create any intervening fields with
the uninitialized value; and cause the value of $0 to be recomputed, with
the fields being separated by the value of <b>OFS</b>. Directly increasing
the value of <b>NF</b> (for example, <b>NF</b> += 2) shall have the same
effect as assigning an empty string to $<b>NF</b> (where <b>NF</b> has its
new value). Decreasing the value of <b>NF</b> to a non-negative value shall
remove all fields after $<b>NF</b> and cause the value of $0 to be
recomputed, with the fields being separated by the value of <b>OFS</b>.
Assigning to <b>NF</b> without changing its value (for example, <b>NF</b> =
<b>NF</b>) shall cause the value of $0 to be recomputed, with the fields
being separated by the value of <b>OFS</b>.</blockquote> 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2024-03-14 11:36 mortoneccc     New Issue                                    
2024-03-14 11:36 mortoneccc     Name                      => Ed Morton       
2024-03-14 11:36 mortoneccc     Section                   => awk             
2024-03-14 11:36 mortoneccc     Page Number               => 0               
2024-03-14 11:36 mortoneccc     Line Number               => 0               
2024-03-15 13:50 salewski       Issue Monitored: salewski                    
2024-05-13 15:07 geoffclare     Note Added: 0006779                          
======================================================================


  • [1003.1(2016... Austin Group Bug Tracker via austin-group-l at The Open Group
    • [1003.1... Austin Group Bug Tracker via austin-group-l at The Open Group
    • [1003.1... Austin Group Bug Tracker via austin-group-l at The Open Group

Reply via email to