Anonymous | Login | 2024-05-10 00:35 UTC |
Main | My View | View Issues | Change Log | Docs |
Viewing Issue Simple Details [ Jump to Notes ] | [ Issue History ] [ Print ] | |||||||||||
ID | Category | Severity | Type | Date Submitted | Last Update | |||||||
0001823 | [1003.1(2016/18)/Issue7+TC2] Shell and Utilities | Comment | Enhancement Request | 2024-03-14 12:26 | 2024-03-14 12:27 | |||||||
Reporter | mortoneccc | View Status | public | |||||||||
Assigned To | ||||||||||||
Priority | normal | Resolution | Open | |||||||||
Status | New | |||||||||||
Name | Ed Morton | |||||||||||
Organization | ||||||||||||
User Reference | ||||||||||||
Section | awk | |||||||||||
Page Number | 0 | |||||||||||
Line Number | 0 | |||||||||||
Interp Status | --- | |||||||||||
Final Accepted Text | ||||||||||||
Summary | 0001823: The impact of changing NR and/or FNR should be defined | |||||||||||
Description |
In most, if not all, modern awks a user can change the value of NR and/or FNR and when the next record is read NR/FNR is incremented from the value the user set it to rather than from the value it previously had: $ seq 3 | awk 'NR==2{NR=7; FNR=23} {print NR, FNR, $0}' 1 1 1 7 23 2 8 24 3 but that behavior is currently not defined by POSIX. |
|||||||||||
Desired Action |
Add statements to the spec like: --- Assigning NR a whole number shall set NR to that value from that point on for processing of the current record and NR shall be incremented starting with that value for all subsequent records read. Assigning NR any other value is undefined behavior. - Assigning FNR a whole number shall set FNR to that value from that point on for processing of the current record and NR shall be incremented starting with that value for all subsequent records read. Assigning NR any other value is undefined behavior. --- |
|||||||||||
Tags | No tags attached. | |||||||||||
Attached Files | ||||||||||||
|
Mantis 1.1.6[^] Copyright © 2000 - 2008 Mantis Group |