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
0001581 [1003.1(2016/18)/Issue7+TC2] Shell and Utilities Editorial Clarification Requested 2022-04-26 15:51 2022-05-05 15:39
Reporter mirabilos View Status public  
Assigned To
Priority normal Resolution Duplicate  
Status Closed  
Name mirabilos
Organization MirBSD
User Reference
Section 2.4
Page Number (page or range of pages)
Line Number (Line or range of lines)
Interp Status ---
Final Accepted Text
Summary 0001581: “time” vs. Korn Shell flavours
Description POSIX currently makes allowances for the Korn Shell flavour of “time” in https://pubs.opengroup.org/onlinepubs/9699919799/utilities/time.html [^] where certain grouping options are unspecified (because “time a | b” in some Korn Shell flavours times the pipeline, not the command “a”).

However, a user reported something that makes the support for this flavour of “time” incomplete: the inability to define a function called “time”.

They can, just not without a backslash, same for using it:

$ function time { echo bar; }
$ time echo foo
foo
    0m00.00s real 0m00.00s user 0m00.00s system
$ \time echo foo
bar
$ time() { echo meh; }
E: /bin/mksh: syntax error: unexpected '{'
$ \time() { echo baz; }
$ \time echo foo
baz

This is because “time” is a keyword, to achieve the aforementioned (and already POSIX-sanctioned) effect.

The user complaint is because “The function is named fname; the application shall ensure that it is a name (see XBD [194]Name) and that it is not the name of a special built-in utility.” (2.9.5) leads to them thinking they can define a function called “time” because “time” is not a special builtin.

The Desired Action, I believe, matches the spirit of the current sanctioning of this behaviour in the “time” utility description by adding “time” to the list of the words that may sometimes be reserved words, making it clear that, yes, the user _can_ define and call a function named “time”, just not as first word on the command line without quoting. It would also not require any change to any implementation.
Desired Action In XSH section 2.4, around line 76309 in the slightly old PDF I have here, add “time” to the list of “words that may be recognised as reserved words on some implementations (when none of the characters are quoted)”.
Tags No tags attached.
Attached Files

- Relationships
duplicate of 0000267Appliedajosey 1003.1(2004)/Issue 6 time (keyword) 

-  Notes
(0005823)
geoffclare (manager)
2022-04-26 16:10

This is a duplicate of bug 0000267

- Issue History
Date Modified Username Field Change
2022-04-26 15:51 mirabilos New Issue
2022-04-26 15:51 mirabilos Name => mirabilos
2022-04-26 15:51 mirabilos Organization => MirBSD
2022-04-26 15:51 mirabilos URL => https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_04 [^]
2022-04-26 15:51 mirabilos Section => 2.4
2022-04-26 16:10 geoffclare Project Online Pubs => 1003.1(2016/18)/Issue7+TC2
2022-04-26 16:10 geoffclare Note Added: 0005823
2022-04-26 16:10 geoffclare Relationship added duplicate of 0000267
2022-05-05 15:39 geoffclare Page Number => (page or range of pages)
2022-05-05 15:39 geoffclare Line Number => (Line or range of lines)
2022-05-05 15:39 geoffclare Interp Status => ---
2022-05-05 15:39 geoffclare Status New => Closed
2022-05-05 15:39 geoffclare Resolution Open => Duplicate


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