Austin Group Defect Tracker

Aardvark Mark IV


Viewing Issue Simple Details Jump to Notes ] Issue History ] Print ]
ID Category Severity Type Date Submitted Last Update
0001821 [1003.1(2016/18)/Issue7+TC2] Shell and Utilities Comment Enhancement Request 2024-03-14 11:42 2024-03-14 12:03
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 0001821: Define the values of $0, $1, etc. in the END section
Description The value of NF, i.e. the number of fields read, in the END section is defined in the standard as:
---
Inside an END action, NF shall retain the value it had for the last record read
---
but the value of $0, $1, and the other fields is not defined. Most modern awks will have them retain the value of the last record read, just like NF, but it is currently undefined behavior which seems like it's a simple omission from the spec.
Desired Action Update the spec to say:
---
Inside an END action, $0, $1, and the other fields shall retain the values they had for the last record read
---
Tags No tags attached.
Attached Files

- Relationships

-  Notes
(0006719)
geoffclare (manager)
2024-03-14 12:03

The suggested wording doesn't work for the NF=0 case. It needs to be something more like:
Inside an END action, $0 and, if NF is greater than 0, the fields $1 through $NF shall retain the values they had for the last record read.

- Issue History
Date Modified Username Field Change
2024-03-14 11:42 mortoneccc New Issue
2024-03-14 11:42 mortoneccc Name => Ed Morton
2024-03-14 11:42 mortoneccc Section => awk
2024-03-14 11:42 mortoneccc Page Number => 0
2024-03-14 11:42 mortoneccc Line Number => 0
2024-03-14 12:03 geoffclare Note Added: 0006719


Mantis 1.1.6[^]
Copyright © 2000 - 2008 Mantis Group
Powered by Mantis Bugtracker