View Issue Details

IDProjectCategoryView StatusLast Update
00007361003.1(2013)/Issue7+TC1Shell and Utilitiespublic2019-06-10 08:55
Reportersalikhmetov Assigned To 
PrioritynormalSeverityCommentTypeEnhancement Request
Status ClosedResolutionAccepted As Marked 
NameAnton Salikhmetov
OrganizationEuroMake Initiative
User Reference
SectionXCU 2.10.2
Page Number2350
Line Number74801-74808
Interp StatusApproved
Final Accepted TextSee 0000736:0001773.
Summary0000736: grammatically accept zero or more Shell commands
DescriptionAn empty Shell program and a program consisting of two or more commands separated with NEWLINE tokens are valid Shell scripts. However, Shell Grammar Rules only accept exactly one single command. That results in a syntax error against both an empty input and two or more commands separated with NEWLINE tokens.
Desired ActionOn page 2350, lines 74801-74808, change

%start complete_command
%%
complete_command : list separator
                 | list
                 ;
list : list separator_op and_or
                 | and_or
                 ;

to

%start script
%%
script : linebreak
                 | compound_list
                 ;
Tagstc2-2008

Relationships

related to 0000718 Closed 1003.1(2013)/Issue7+TC1 sh -i -c '...' should not read its input from terminal 
related to 0000648 Closedajosey 1003.1(2008)/Issue 7 Special treatment of <newline> in tokenization rules is unnecessary 
related to 0000953 Closedajosey 1003.1(2013)/Issue7+TC1 Alias expansion is under-specified 

Activities

salikhmetov

2013-08-18 10:15

reporter   bugnote:0001729

Last edited: 2013-08-30 11:29

A complete_command non-terminal needs to be distinguished grammatically from a compound_list non-terminal. Indeed, compound_list is to be saved for later execution, while complete_command is executed immediately. The suggested desired action requires the following correction.

Below, the separator non-terminal is replaced with separator_op in order to avoid shift/reduce conflicts due to the trailing newline_list non-terminals embedded in the definition of the separator and linebreak non-terminals:

linebreak : newline_list
                 | /* empty */
                 ;
separator_op : '&'
                 | ';'
                 ;
separator : separator_op linebreak
                 | newline_list
                 ;

On page 2350, lines 74801-74808, change

%start complete_command
%%
complete_command : list separator
                 | list
                 ;

to

%start script
%%
script : linebreak commands linebreak
                 | linebreak
                 ;
commands : commands newline_list complete_command
                 | complete_command
                 ;
complete_command : list separator_op
                 | list
                 ;

Don Cragun

2013-08-29 16:20

manager   bugnote:0001773

Last edited: 2013-08-30 11:15

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 following changes make the grammar and text reflect existing practice.

Notes to the Editor (not part of this interpretation):
-------------------------------------------------------
On page 2350, lines 74801-74808, change
%start  complete_command
%%
complete_command : list separator
                 | list
                 ;

to:
%start program
%%
program          : linebreak complete_commands linebreak
                 | linebreak
                 ;
complete_commands: complete_commands newline_list complete_command
                 |                                complete_command
                 ;
complete_command : list separator_op
                 | list
                 ;


Cross-volume change to XRAT...
At page 3700 line 126612 section C.2.10 delete:

The start symbol of the grammar (complete_command) represents either input from the
command line or a shell script. It is repeatedly applied by the interpreter to its input and
represents a single ‘‘chunk’’ of that input as seen by the interpreter.


ajosey

2013-09-06 04:52

manager   bugnote:0001800

Interpretation Proposed 6 Sep 2013

ajosey

2013-10-14 13:09

manager   bugnote:0001900

Interpretation approved 14 October 2013

Issue History

Date Modified Username Field Change
2013-08-17 09:59 salikhmetov New Issue
2013-08-17 09:59 salikhmetov Name => Anton Salikhmetov
2013-08-17 09:59 salikhmetov Organization => EuroMake Initiative
2013-08-17 09:59 salikhmetov Section => XCU 2.10.2
2013-08-17 09:59 salikhmetov Page Number => 2350
2013-08-17 09:59 salikhmetov Line Number => 74801-74808
2013-08-18 10:15 salikhmetov Note Added: 0001729
2013-08-22 16:08 nick Relationship added related to 0000718
2013-08-24 06:52 salikhmetov Note Edited: 0001729
2013-08-29 16:20 Don Cragun Note Added: 0001773
2013-08-29 16:21 nick Relationship added related to 0000648
2013-08-29 16:22 Don Cragun Interp Status => Pending
2013-08-29 16:22 Don Cragun Final Accepted Text => See 0000736:0001773.
2013-08-29 16:22 Don Cragun Status New => Interpretation Required
2013-08-29 16:22 Don Cragun Resolution Open => Accepted As Marked
2013-08-29 16:22 Don Cragun Tag Attached: tc2-2008
2013-08-30 11:15 salikhmetov Note Edited: 0001773
2013-08-30 11:29 salikhmetov Note Edited: 0001729
2013-09-06 04:52 ajosey Interp Status Pending => Proposed
2013-09-06 04:52 ajosey Note Added: 0001800
2013-10-14 13:09 ajosey Interp Status Proposed => Approved
2013-10-14 13:09 ajosey Note Added: 0001900
2016-04-14 20:18 rhansen Relationship added related to 0000953
2019-06-10 08:55 agadmin Status Interpretation Required => Closed