View Issue Details

IDProjectCategoryView StatusLast Update
00008821003.1(2013)/Issue7+TC1Shell and Utilitiespublic2019-06-10 08:54
Reporterrhansen Assigned To 
PrioritynormalSeverityEditorialTypeClarification Requested
Status ClosedResolutionAccepted As Marked 
NameRichard Hansen
OrganizationBBN
User Reference
Section2.8.1 Consequences of Shell Errors
Page Number2337
Line Number74290
Interp StatusApproved
Final Accepted TextSee 0000882:0002528 and 0000882:0002606
Summary0000882: meaning of "utility syntax error" unclear
DescriptionThe table listing the consequences of shell errors contains an entry for "Utility syntax error (option or operand error)". It's not entirely clear what this means.

For example, is 'set -o some_unknown_option' considered to be a "utility syntax error"? I wouldn't consider it to be a syntax error, though I would consider it to be an option/operand error. It's certainly not a syntax error in the same sense as 'eval "{"'.

See: http://thread.gmane.org/gmane.comp.standards.posix.austin.general/9907/focus=9934
Desired Action(to be added later; I just wanted to file this bug report so that we don't forget about this issue that was raised in the email thread)
Tagstc2-2008

Relationships

related to 0000717 Closed meaning of "the shell shall exit" in a subshell environment 
related to 0000913 Closed mention resource exhaustion as a possible source of errors for all utilities 
related to 0000960 Closed export can fail 
child of 0000914 Closed redirection error with function invocations or compound commands should not cause the shell to exit 

Activities

rhansen

2015-01-22 17:33

manager   bugnote:0002527

On page 2337 lines 74285-74287 (XCU 2.8.1 Consequences of Shell Errors), change:
For a non-interactive shell, an error condition encountered by a special built-in (see Section 2.14) or other type of utility shall cause the shell to write a diagnostic message to standard error and exit as shown in the following table:
to:
Certain errors shall cause the shell to write a diagnostic message to standard error and exit as shown in the following table:
On page 2337 lines 74288-74295 (XCU 2.8.1 Consequences of Shell Errors table), change:
Error | Special Built-In | Other Utilities
------------------------------------------------------------
Shell language syntax error | Shall exit | Shall exit
Utility syntax error (option or operand error) | Shall exit | Shall not exit
Redirection error | Shall exit | Shall not exit
Variable assignment error | Shall exit | Shall not exit
Expansion error | Shall exit | Shall exit
Command not found | N/A | May exit
Dot script not found | Shall exit | N/A
to:
Error | Non-Interactive Shell | Interactive Shell | Shell Diagnostic Message Required
-------------------------------------------------------------------
Shell language syntax error | shall exit | shall not exit | yes
Special built-in utility error | shall exit | shall not exit | no(1)
Other utility (not a special built-in) error | shall not exit | shall not exit | no(2)
Redirection error with special built-in utilities | shall exit | shall not exit | yes
Redirection error with compound commands | may exit(3) | shall not exit | yes
Redirection error with function execution | may exit(3) | shall not exit | yes
Redirection error with other utilities (not special built-ins) | shall not exit | shall not exit | yes
Variable assignment error | shall exit | shall not exit | yes
Expansion error | shall exit | shall not exit | yes
Command not found | may exit | shall not exit | yes
Notes:
  • (1) Although special built-ins are part of the shell, a diagnostic message written by a special built-in is not considered to be a shell diagnostic message, and can be redirected like any other utility.
  • (2) The shell is not required to write a diagnostic message, but the utility itself shall write a diagnostic message if required to do so.
  • (3) A future version of this standard may require the shell to not exit in this condition.
On page 2337 lines 74303-74304 (XCU 2.8.1 Consequences of Shell Errors), delete:
In all of the cases shown in the table, an interactive shell shall write a diagnostic message to standard error without exiting.
On page 2356 lines 75100-75104 (XCU 2.14 list item 1), change:
  1. A syntax error in a special built-in utility may cause a shell executing that utility to abort, while a syntax error in a regular built-in utility shall not cause a shell executing that utility to abort. (See Section 2.8.1 for the consequences of errors on interactive and non-interactive shells.) If a special built-in utility encountering a syntax error does not abort the shell, its exit value shall be non-zero.
to:
  1. An error in a special built-in utility may cause a shell executing that utility to abort, while an error in a regular built-in utility shall not cause a shell executing that utility to abort. (See Section 2.8.1 for the consequences of errors on interactive and non-interactive shells.) If a special built-in utility encountering an error does not abort the shell, its exit value shall be non-zero.

Don Cragun

2015-01-22 17:54

manager   bugnote:0002528

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 standard is unclear on what constitutes a "Shell Error".

Notes to the Editor (not part of this interpretation):
-------------------------------------------------------
Make the changes suggested in 0000882:0002527.

rhansen

2015-01-22 18:13

manager   bugnote:0002529

Should the diagnostic message column for the "Special built-in utility error" case get both notes (1) and (2)?
Special built-in utility error | shall exit | shall not exit | no(1)(2)

ajosey

2015-02-20 12:12

manager   bugnote:0002551

Just correction Interp status - prior to processing the current interps queue.

ajosey

2015-02-20 12:13

manager   bugnote:0002555

Interpretation proposed 20 Feb 2015

ajosey

2015-03-23 12:08

manager   bugnote:0002598

Interpretation approved 23rd March 2015

geoffclare

2015-03-26 15:17

manager   bugnote:0002606

The change to remove the last sentence in XCU 2.8.1 conflicts with 0000717 which modifies the same text. The new aspects of that modified text should be retained. The following alternative change achieves this and the editors propose to include it in the TC2 draft:

On page 2337 lines 74303-74304 (XCU 2.8.1 Consequences of Shell Errors), change:

In all of the cases shown in the table, an interactive shell shall write a diagnostic message to standard error without exiting.

to:

In all of the cases shown in the table where an interactive shell is required not to exit, the shell shall not perform any further processing of the command in which the error occurred.

Issue History

Date Modified Username Field Change
2014-10-12 20:44 rhansen New Issue
2014-10-12 20:44 rhansen Name => Richard Hansen
2014-10-12 20:44 rhansen Organization => BBN
2014-10-12 20:44 rhansen Section => 2.8.1 Consequences of Shell Errors
2014-10-12 20:44 rhansen Page Number => 2337
2014-10-12 20:44 rhansen Line Number => 74290
2014-10-12 20:44 rhansen Interp Status => ---
2015-01-22 17:33 rhansen Note Added: 0002527
2015-01-22 17:51 rhansen Relationship added related to 0000913
2015-01-22 17:54 Don Cragun Interp Status --- => Proposed
2015-01-22 17:54 Don Cragun Final Accepted Text => See 0000882:0002528.
2015-01-22 17:54 Don Cragun Note Added: 0002528
2015-01-22 17:54 Don Cragun Status New => Interpretation Required
2015-01-22 17:54 Don Cragun Resolution Open => Accepted As Marked
2015-01-22 17:54 Don Cragun Tag Attached: tc2-2008
2015-01-22 18:07 rhansen Relationship added child of 0000914
2015-01-22 18:13 rhansen Note Added: 0002529
2015-02-20 12:12 ajosey Interp Status Proposed => Pending
2015-02-20 12:12 ajosey Note Added: 0002551
2015-02-20 12:13 ajosey Interp Status Pending => Proposed
2015-02-20 12:13 ajosey Note Added: 0002555
2015-03-23 12:08 ajosey Interp Status Proposed => Approved
2015-03-23 12:08 ajosey Note Added: 0002598
2015-03-25 12:37 geoffclare Relationship added related to 0000717
2015-03-26 15:17 geoffclare Note Added: 0002606
2015-03-26 15:23 geoffclare Final Accepted Text See 0000882:0002528. => See 0000882:0002528 and 0000882:0002606
2015-06-18 17:23 eblake Relationship added related to 0000960
2019-06-10 08:54 agadmin Status Interpretation Required => Closed