A NOTE has been added to this issue. 
====================================================================== 
https://austingroupbugs.net/view.php?id=267 
====================================================================== 
Reported By:                Don Cragun
Assigned To:                ajosey
====================================================================== 
Project:                    1003.1(2004)/Issue 6
Issue ID:                   267
Category:                   Shell and Utilities
Type:                       Clarification Requested
Severity:                   Objection
Priority:                   normal
Status:                     Under Review
Name:                       Don Cragun 
Organization:                
User Reference:              
Section:                    time 
Page Number:                916-919 
Line Number:                35505-35633 
Interp Status:              --- 
Final Accepted Text:        WAS https://austingroupbugs.net/view.php?id=267#c442
and https://austingroupbugs.net/view.php?id=267#c1692 
====================================================================== 
Date Submitted:             2010-06-25 16:19 UTC
Last Modified:              2020-03-06 07:18 UTC
====================================================================== 
Summary:                    time (keyword)
======================================================================
Relationships       ID      Summary
----------------------------------------------------------------------
related to          0000789 Add set -o pipefail
has duplicate       0001051 stderr redirection of the "time&qu...
related to          0000723 time is not allowed to write error mess...
====================================================================== 

---------------------------------------------------------------------- 
 (0004794) kre (reporter) - 2020-03-06 07:18
 https://austingroupbugs.net/view.php?id=267#c4794 
---------------------------------------------------------------------- 
A proposed resolution to this issue (will need word smithing and
formatting):

In XCU 2.4:

Change the paragraph at lines 74823-4 (page 2349) from:

        The following words may be recognized as reserved words on
        some implementations (when none of the characters are quoted),
        causing unspecified results:
to:
        The following words, when used as required above in the
        circumstances where words can be recognised as reserved words,
        may be treated as reserved words, causing unspecified results:

In line 74825 (page 2349) after the word "select" add "time".

Add a new paragraph between lines 74825 and 74826 (page 2349):

        When the word "time" is recognised as a reserved word,
        it shall be implemented in such a manner that when used
        in circumstances where it would, were it not a reserved
        word, be treated as the simple-command invoking the
        utility time[xref...] in a manner that its operation would
        produce specified results (without requiring it be invoked
        in a manner to necessarily produce a specified output format)
        then the results shall be indistinguishable (other than
        in terms of execution speed or possible side effects) from
        invoking the time utility as specified [xref].

Change the paragraph in lines 74826-7 (page 2349) from:

        Words that are the concatenation of a name and a <colon> (':')
        are reserved; their use produces unspecified results.
to:
        When used in a context and manner where recognition as a reserved
        word would be possible, every word where the final character is a
        <colon> (':') is reserved, use of such a word in that context
        produces unspecified results.

In XCU 4, in the description of the time utility (page 3297), change
the paragraph and following examples in lines 110983-8 from:

        When time is used as part of a pipeline, the times reported
        are unspecified, except when it is the sole command within a
        grouping command (see Section 2.9.4.1, on page 2371) in that
pipeline.
        For example, the commands on the left are unspecified; those on
        the right report on utilities a and c, respectively:

        time a | b | c            { time a; } | b | c
        a | b | time c            a | b | (time c)

to:

        When any input or output redirections [xref], including those
        implied by use in a pipeline [xref], are applied to the
simple-command
        which invokes the time utility, or when the next non-empty word
        that follows "time" would be, were "time" not present, a reserved
        word, control operator, or be, or expand to, the name of any
built-in
        utility or function, the results (including parsing) are
unspecified.

        The limitation on redirections can be overcome by embedding the
        simple-command that invokes the time utility within a
compound-command
        (most commonly a group, or subshell) [xref] and applying any
desired
        redirections to the compound-command instead.  Alternatively, the
time
        utility may be invoked via the command or env utilities, or by
        quoting some or all of the word "time".

        Note that in no specified usage is it possible to apply different
        redirections to the time utility than are applied to the utility
        it invokes.

        The following examples (where 'a' and 'b' are assumed to be the
        names of other utilities) show unspecified usages:

                time a arg1 arg2 | b            # output redirection
(pipeline)
                a | time -p b                   # input redirection
(pipeline)
                time a >/dev/null               # output redirection
(explicit)
                </dev/null time cat             # input redirection
(explicit)
                time while anything...          # reserved word after
"time"
                time ( cmd )                    # control operator after
"time"
                time;                           # control operator after
"time"
                time cd /                       # built-in utility after
"time"

        The following examples of specified usages may be used as
        alternatives for the first four of those when the time
        utility as specified here is intended to be invoked:

                { time a arg1 arg2; } | b
                a | for x in x; do time -p b; done
                command time a >/dev/null
                </dev/null \time cat

In XRAT C.2.4 (page 3721) change the paragraph at lines 127556-9 from:

        The list of unspecified reserved words is from the KornShell,
        so conforming applications cannot use them in places a reserved
        word would be recognized. This list contained time in early
proposals,
        but it was removed when the time utility was selected for the
Shell
        and Utilities volume of POSIX.1-2017.
to:
        The list of unspecified reserved words is from the KornShell,
        so conforming applications cannot use them in places a reserved
        word would be recognized.  Earlier versions of this standard
        omitted time from this list, in order that the time utility could
        be included without requiring quoting its name to avoid it being
        treated as a reserved word, but as the intent was to allow the
        reserved word implementation (as evidenced by use of time in
        pipelines being unspecified, and explicit mention in the rationale
        of the time utility), which is inconsistent with time not being
        a reserved word - for example: if time is a reserved word, it
cannot
        be defined as a function, which it should be able to be if not
        a reserved word.   Hence time has been returned to the list of
        unspecified reserved words, but with its use as a reserved word
        limited to be compatible with its use as a utility in the cases
        where the two have traditionally had the same effect (other than
        possible output format differences).

On the same page (3719), change the paragraph at lines 127564-5 from:

        The restriction on ending a name with a <colon> is to allow future
        implementations that support named labels for flow control; see
the
        RATIONALE for the break built-in utility.
to:
        Words that are used in a way consistent with being a reserved
word,
        and which end with a <colon> are all reserved, to allow for future
        additions to the standard.   The case of a name suffixed with a
colon
        is reserved with the intent that at some unlikely future time
support
        for named labels for flow control might be specified; see the
RATIONALE
        for the break built-in utility.  Other words ending in <colon> are
        reserved to provide a mechanism to allow new reserved words to be
        added to the standard if required without causing prior existing
        conforming scripts to fail.


Aside: this has nothing whatever to do with issue 267, but in that same
section of rationale, I'd also suggest deleting the stuff about '{' and
'}'
potentially turning into control operators.   That may have seemed a
plausible future direction in 1988, but it isn't any more, too much time
has passed to make that kind of change now. 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2010-06-25 16:19 geoffclare     New Issue                                    
2010-06-25 16:19 geoffclare     Status                   New => Under Review 
2010-06-25 16:19 geoffclare     Assigned To               => ajosey          
2010-06-25 16:19 geoffclare     Name                      => Don Cragun      
2010-06-25 16:19 geoffclare     Section                   => time            
2010-06-25 16:19 geoffclare     Page Number               => 916-919         
2010-06-25 16:19 geoffclare     Line Number               => 35505-35633     
2010-06-25 16:19 geoffclare     Interp Status             => ---             
2010-06-25 16:20 geoffclare     Note Added: 0000437                          
2010-06-25 16:20 geoffclare     Reporter                 geoffclare => Don
Cragun
2010-06-26 17:52 geoffclare     Note Added: 0000442                          
2010-06-26 17:54 geoffclare     Interp Status            --- => Pending      
2010-06-26 17:54 geoffclare     Final Accepted Text       =>
https://austingroupbugs.net/view.php?id=267#c442     
2010-06-26 17:54 geoffclare     Status                   Under Review =>
Interpretation Required
2010-06-26 17:54 geoffclare     Resolution               Open => Accepted As
Marked
2010-07-30 08:19 ajosey         Interp Status            Pending => Proposed 
2010-07-30 08:19 ajosey         Note Added: 0000493                          
2010-09-03 16:38 ajosey         Interp Status            Proposed => Approved
2013-07-16 15:20 geoffclare     Relationship added       related to 0000723  
2013-08-01 15:13 geoffclare     Note Added: 0001692                          
2013-08-01 15:14 geoffclare     Final Accepted Text     
https://austingroupbugs.net/view.php?id=267#c442 =>
https://austingroupbugs.net/view.php?id=267#c442 and
https://austingroupbugs.net/view.php?id=267#c1692
2013-08-01 15:15 geoffclare     Note Edited: 0001692                         
2016-05-04 15:10 geoffclare     Relationship added       related to 0001051  
2016-05-04 18:21 shware_systems Tag Attached: issue8                         
2016-05-05 22:18 stephane       Note Added: 0003199                          
2016-05-05 22:19 stephane       Note Edited: 0003199                         
2016-05-06 07:46 stephane       Note Edited: 0003199                         
2016-05-09 10:06 joerg          Note Added: 0003202                          
2016-05-11 11:38 stephane       Note Added: 0003209                          
2016-05-11 11:57 joerg          Note Added: 0003210                          
2016-05-11 11:58 joerg          Note Edited: 0003210                         
2016-05-11 11:59 joerg          Note Edited: 0003210                         
2016-05-11 12:31 stephane       Note Added: 0003211                          
2016-05-11 12:47 joerg          Note Added: 0003212                          
2016-05-11 12:47 joerg          Note Edited: 0003212                         
2016-05-11 12:49 joerg          Note Edited: 0003212                         
2016-05-11 13:14 stephane       Note Added: 0003213                          
2016-05-11 13:28 joerg          Note Added: 0003214                          
2016-05-11 13:28 joerg          Note Edited: 0003214                         
2016-05-11 13:42 stephane       Note Edited: 0003211                         
2016-05-11 13:43 joerg          Note Edited: 0003210                         
2017-06-08 15:08 geoffclare     Relationship replaced    has duplicate 0001051
2020-02-06 10:01 geoffclare     Interp Status            Approved => ---     
2020-02-06 10:01 geoffclare     Final Accepted Text     
https://austingroupbugs.net/view.php?id=267#c442 and
https://austingroupbugs.net/view.php?id=267#c1692 => WAS
https://austingroupbugs.net/view.php?id=267#c442 and
https://austingroupbugs.net/view.php?id=267#c1692
2020-02-06 10:01 geoffclare     Note Added: 0004771                          
2020-02-06 10:01 geoffclare     Status                   Interpretation Required
=> Under Review
2020-02-06 10:01 geoffclare     Resolution               Accepted As Marked =>
Reopened
2020-02-06 10:01 geoffclare     Tag Detached: issue8                         
2020-02-06 10:02 geoffclare     Relationship added       related to 0000789  
2020-03-06 07:18 kre            Note Added: 0004794                          
======================================================================


Reply via email to