Anonymous | Login | 2021-02-25 19:01 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 | ||
0000974 | [1003.1(2013)/Issue7+TC1] Shell and Utilities | Editorial | Error | 2015-08-10 11:09 | 2019-10-21 09:22 | ||
Reporter | stephane | View Status | public | ||||
Assigned To | |||||||
Priority | normal | Resolution | Accepted As Marked | ||||
Status | Applied | ||||||
Name | Stephane Chazelas | ||||||
Organization | |||||||
User Reference | |||||||
Section | awk | ||||||
Page Number | 2460 | ||||||
Line Number | 78773-78782 | ||||||
Interp Status | Approved | ||||||
Final Accepted Text | See Note: 0003231 | ||||||
Summary | 0000974: several issues with awk's ARGC/ARGV | ||||||
Description |
The description of ARGC/ARGV in the awk specification implies that it contains the list of arguments (to the exclusion of progname) while all awk implementations that I tried have the basename of the argv[0] that awk received in ARGV[0]. It also doesn't specify what should happen if one sets ARGC to 0 or 1, or what the effect of assigning ARGV[0] may be. Or of assigning all of ARGV[1]..ARGV[ARGC-1] to null. It doesn't say what's the consequence of doing: c=ARGC; ARGC=0; ARGC=c (whether setting ARGC=0 would truncate the ARGV array). |
||||||
Desired Action |
Specify that ARGV[0] is the basename(argv[0]) and is otherwise not used and assigning a value to it has no side effect (it is not used for error reporting by awk for instance in any implementation I tried). Specifify that setting ARGC to 0 or 1 causes awk to read input from stdin if done from the BEGIN statement. But otherwise setting ARGC to a number that would exclude the currently processed file (as in `awk '{ARGC=1; print}' file`) is unspecified (some awk stop processing after the current record, some at the end of the current file). Specify that setting or all of ARGV[1]..ARGV[ARGC-1] to null where ARGC > 1 in the BEGIN statement is unspecified (mawk and gawk read from stdin, but heirloom's just exits at the end of the BEGIN statement). Specify that modifying the value of ARGC doesn't affect the content of ARGV. |
||||||
Tags | tc3-2008 | ||||||
Attached Files | |||||||
|
![]() |
|||
Date Modified | Username | Field | Change |
2015-08-10 11:09 | stephane | New Issue | |
2015-08-10 11:09 | stephane | Name | => Stephane Chazelas |
2015-08-10 11:09 | stephane | Section | => awk |
2015-08-10 11:09 | stephane | Page Number | => 2460 |
2015-08-10 11:09 | stephane | Line Number | => 78773-78782 |
2015-08-10 13:53 | geoffclare | Note Added: 0002787 | |
2015-08-10 16:02 | stephane | Note Added: 0002788 | |
2016-05-19 16:31 | rhansen | Note Added: 0003231 | |
2016-05-19 16:35 | rhansen | Note Edited: 0003231 | |
2016-05-19 16:38 | rhansen | Note Edited: 0003231 | |
2016-05-19 16:39 | rhansen | Note Edited: 0003231 | |
2016-05-19 16:43 | rhansen | Note Edited: 0003231 | |
2016-05-19 16:44 | rhansen | Interp Status | => Pending |
2016-05-19 16:44 | rhansen | Final Accepted Text | => See Note: 0003231 |
2016-05-19 16:44 | rhansen | Status | New => Interpretation Required |
2016-05-19 16:44 | rhansen | Resolution | Open => Accepted As Marked |
2016-05-19 16:44 | rhansen | Tag Attached: tc3-2008 | |
2016-12-15 18:11 | ajosey | Interp Status | Pending => Proposed |
2016-12-15 18:11 | ajosey | Note Added: 0003523 | |
2017-01-18 15:24 | ajosey | Interp Status | Proposed => Approved |
2017-01-18 15:24 | ajosey | Note Added: 0003551 | |
2019-10-21 09:22 | geoffclare | Status | Interpretation Required => Applied |
Mantis 1.1.6[^] Copyright © 2000 - 2008 Mantis Group |