View Issue Details

IDProjectCategoryView StatusLast Update
00004171003.1(2008)/Issue 7Shell and Utilitiespublic2013-04-16 13:06
Reporterjilles Assigned Toajosey  
PrioritynormalSeverityEditorialTypeClarification Requested
Status ClosedResolutionAccepted As Marked 
NameJilles Tjoelker
Organization
User Reference
Section2.6.2 Parameter Expansion
Page Number2306-2307
Line Number72725-72729, 72747-72749
Interp StatusApproved
Final Accepted TextSee 0000417:0000800
Summary0000417: ${#?} is ambiguous
DescriptionThe expansion ${#?} can be interpreted both as the length of $? and as $# giving an error in the (impossible) case that it is not set.

That is ${#parameter} with parameter "?" or ${parameter?[word]} with parameter "#" and no word.

Because the former interpretation is most common and the only one which
may have some use, I would suggest requiring that one.

If word is to be made optional in other forms of parameter expansion as well, similar problems will arise with ${#-} and ${##}.
Desired ActionAfter the paragraph about ${parameter:?[word]}, add something like:

If parameter is '#', word must be specified.
This is necessary to avoid ambiguity with the string length expansion.

Alternatively, it could be left unspecified by also adding restrictions
which special parameters ${#parameter} may be applied to.
Tagstc1-2008

Relationships

related to 0000457 Closedajosey omitted word in parameter expansions 

Activities

nick

2011-06-02 16:01

manager   bugnote:0000800

Last edited: 2011-06-02 16:06

Interpretation response
------------------------
The standard is unclear on this issue, and no conformance distinction can be made between alternative implementations based on this. This is being referred to the sponsor.

Rationale:
-------------
The expansion ${#?} can be interpreted both as the length of $? and as $# giving an error in the (impossible) case that it is not set.


Notes to the Editor (not part of this interpretation):
-------------------------------------------------------
At line 72734 insert a sentence before "The following table summarizes ...":

If parameter is '#' and the colon is omitted, the application shall ensure that word is specified (this is necessary to avoid ambiguity with the string length expansion).

ajosey

2011-06-16 10:17

manager   bugnote:0000849

Interpretation proposed 16 June 2011 for final 30 day review

ajosey

2011-07-29 06:13

manager   bugnote:0000903

The interpretation is now approved.

Issue History

Date Modified Username Field Change
2011-04-22 23:11 jilles New Issue
2011-04-22 23:11 jilles Status New => Under Review
2011-04-22 23:11 jilles Assigned To => ajosey
2011-04-22 23:11 jilles Name => Jilles Tjoelker
2011-04-22 23:11 jilles Section => 2.6.2 Parameter Expansion
2011-04-22 23:11 jilles Page Number => 2306-2307
2011-04-22 23:11 jilles Line Number => 72725-72729, 72747-72749
2011-06-02 16:01 nick Note Added: 0000800
2011-06-02 16:03 nick Note Edited: 0000800
2011-06-02 16:05 nick Interp Status => ---
2011-06-02 16:05 nick Final Accepted Text => See 0000417:0000800
2011-06-02 16:05 nick Status Under Review => Interpretation Required
2011-06-02 16:05 nick Resolution Open => Accepted As Marked
2011-06-02 16:06 nick Note Edited: 0000800
2011-06-02 16:06 nick Note Edited: 0000800
2011-06-02 16:07 nick Tag Attached: tc1-2008
2011-06-02 16:07 nick Interp Status --- => Pending
2011-06-03 18:24 eblake Relationship added related to 0000457
2011-06-16 10:17 ajosey Interp Status Pending => Proposed
2011-06-16 10:17 ajosey Note Added: 0000849
2011-07-29 06:13 ajosey Interp Status Proposed => Approved
2011-07-29 06:13 ajosey Note Added: 0000903
2013-04-16 13:06 ajosey Status Interpretation Required => Closed