View Issue Details

IDProjectCategoryView StatusLast Update
00006431003.1(2008)/Issue 7Shell and Utilitiespublic2019-06-10 08:55
Reporterrhansen Assigned Toajosey  
PrioritynormalSeverityObjectionTypeError
Status ClosedResolutionAccepted As Marked 
NameRichard Hansen
Organization
User Reference
Section2.10.2
Page Number2326
Line Number73470-73481
Interp StatusApproved
Final Accepted TextSee 0000643:0001448
Summary0000643: Reduction of TOKEN to WORD or ASSIGNMENT_WORD broken when TOKEN contains an equals sign
DescriptionEach of the following:
    ${foo=bar}
    $(foo=bar; baz)
    $((foo=bar))
    ~foo=bar/baz
    "foo=bar"
    foo\=bar
is one token according to XCU 2.3. According to XCU 2.10.2, the tokens match cmd_name, so rule 7a is applied. Each token contains an equals sign, so rule 7a says to apply rule 7b. The tokens do not begin with '=', nor do all characters preceding '=' form a valid name, so according to 7b it is unspecified whether ASSIGNMENT_WORD or WORD is returned. I believe WORD should be returned in these cases.

In addition:
  - The second bullet of rule 7b is unclear when TOKEN contains multiple <equals-sign> characters.
  - The phrase "all the characters preceding '='" could refer to characters in previous tokens. I believe the intention is to only refer to the preceding characters in the current token.
Desired ActionChange the second bullet in rule 7b from:

    - If all the characters preceding '=' form a valid name (see XBD Section 3.231), the token ASSIGNMENT_WORD shall be returned. (Quoted characters cannot participate in forming a valid name.)

to:

    - If all the token's characters preceding the first '=' form a valid name (see XBD Section 3.231), the token ASSIGNMENT_WORD shall be returned. (Quoted characters cannot participate in forming a valid name.)

And insert a new bullet after the second bullet in rule 7b:

    - If there are no unquoted <equals-sign> characters (excluding unquoted <equals-sign> characters in applicable tilde expansions, parameter expansions, command substitutions, and arithmetic expansions), WORD is returned.

(The suggested bullet could use some wordsmithing, but I believe the intention is clear.)
Tagstc2-2008

Relationships

has duplicate 0000578 Closedajosey 1003.1(2008)/Issue 7 "NAME" should be unbolded and lowercased 
related to 0000839 Closed 1003.1(2013)/Issue7+TC1 problems with reduction of WORD to ASSIGNMENT_WORD 

Activities

nick

2013-01-17 17:27

manager   bugnote:0001448

Last edited: 2013-01-17 17:28

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 current wording is ambiguous. However, there are currently conforming implementations with extensions (e.g. array assignments) that should not be outlawed by adding additional restrictions here.

Notes to the Editor (not part of this interpretation):
-------------------------------------------------------
At page 2326, line 73477 change
 If all the characters preceding ’=’ ...

to:
 If all the characters in the TOKEN preceding the first '=' ...

On page 2326 line 73482 change:
 Assignment to the NAME shall occur ...
to:
 Assignment to the name within a returned ASSIGNMENT_WORD token shall occur ...

ajosey

2013-03-29 08:04

manager   bugnote:0001516

Interpretation Proposed 29 Mar 2013

ajosey

2013-05-03 12:20

manager   bugnote:0001580

Interpretation approved 3 May 2013

ajosey

2014-02-19 15:30

manager   bugnote:0002141

The second change in the Notes to the Editor (bugnote 01448) appears to already be covered by the change in Bug 578. The proposal here has slightly different wording to bug 578

Bug 578:

Change Number: XCU/TC2/D1/nn [578]

On Page: 2326 Line: 73482 Section: 2.10.2

In section 2.10.2 Shell Grammar Rules, change from:

Assignment to the NAME shall occur as specified in Section 2.9.1.


to:

Assignment to the name before the '=' in the ASSIGNMENT_WORD shall occur as specified in Section 2.9.1

geoffclare

2014-02-19 16:22

manager   bugnote:0002143

Since this bug is an approved interpretation and 0000578 is not, we should probably use the wording from this bug in TC2 and retrospectively make 578 a duplicate of it.

Issue History

Date Modified Username Field Change
2013-01-16 04:08 rhansen New Issue
2013-01-16 04:08 rhansen Status New => Under Review
2013-01-16 04:08 rhansen Assigned To => ajosey
2013-01-16 04:08 rhansen Name => Richard Hansen
2013-01-16 04:08 rhansen Section => 2.10.2
2013-01-16 04:08 rhansen Page Number => 2349
2013-01-16 04:08 rhansen Line Number => 74750--74761
2013-01-17 16:52 msbrown Project 2008-TC1 => 1003.1(2008)/Issue 7
2013-01-17 16:54 msbrown Page Number 2349 => 2326
2013-01-17 16:54 msbrown Line Number 74750--74761 => 73470-73481
2013-01-17 16:54 msbrown Interp Status => ---
2013-01-17 17:27 nick Note Added: 0001448
2013-01-17 17:28 nick Interp Status --- => Pending
2013-01-17 17:28 nick Final Accepted Text => See 0000643:0001448
2013-01-17 17:28 nick Status Under Review => Interpretation Required
2013-01-17 17:28 nick Resolution Open => Accepted As Marked
2013-01-17 17:28 nick Tag Attached: tc2-2008
2013-01-17 17:28 nick Note Edited: 0001448
2013-03-29 08:04 ajosey Interp Status Pending => Proposed
2013-03-29 08:04 ajosey Note Added: 0001516
2013-05-03 12:20 ajosey Interp Status Proposed => Approved
2013-05-03 12:20 ajosey Note Added: 0001580
2014-02-19 15:30 ajosey Note Added: 0002141
2014-02-19 16:22 geoffclare Note Added: 0002143
2014-02-20 16:21 geoffclare Relationship added has duplicate 0000578
2014-05-22 15:25 nick Relationship added related to 0000839
2019-06-10 08:55 agadmin Status Interpretation Required => Closed