View Issue Details

IDProjectCategoryView StatusLast Update
00002801003.1(2008)/Issue 7Shell and Utilitiespublic2013-04-16 13:06
Reportercalestyo Assigned Toajosey  
PrioritynormalSeverityEditorialTypeClarification Requested
Status ClosedResolutionAccepted As Marked 
NameChristoph Anton Mitterer
Organization
User Reference
Sectionset built-in utility
Page Number2358-2359
Line Number74545-74548,74590-74591
Interp Status---
Final Accepted TextSee 0000280:0000481
Summary0000280: description is not clear enought on what happens if the shell immediately exits
Descriptionset allows to set several events on which the shell immediately exits (e.g. -e and -u).

It does however (at least in that place - http://www.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#set) not specify the consequences (e.g. the exit status).
Desired ActionClarification of the above.
Tagstc1-2008

Relationships

related to 0000155 Closedajosey set -u should require an error when $1 etc. are unset 
related to 0000559 Closedajosey arithmetic expansion should honor 'set -u' 

Activities

geoffclare

2010-07-08 09:10

manager   bugnote:0000457

In the case of -e the exit status is adequately described in the EXIT
STATUS section on the sh page. The description of set -e cannot
specify the final exit status of the shell because it might depend on
commands executed in an EXIT trap.

In the case of -u this does look like a genuine omission. Again, it
cannot specify the final exit status of the shell, but it should say
something about the exit status of the (unexecuted) command in which
the unset variable was used. This would then determine the exit
status of the shell in the absence of an EXIT trap (and would be
assigned to $? in an interactive shell).

The description of set -u is already being modified by 0000155. A
suitable new description that fixes both problems might be:

    When the shell tries to expand an unset parameter other than the '@'
    and '*' special parameters, it shall write a message to standard
    error and shall not execute the command containing the expansion,
    but for the purposes of setting the '?' special parameter and the
    exit status of the shell the command shall be treated as having
    been executed and returned an exit status of between 1 and 125
    inclusive. A non-interactive shell shall immediately exit. An
    interactive shell shall not exit.

calestyo

2010-07-12 21:46

reporter   bugnote:0000461

One could (for -e) add a note and link to EXIT STATUS section, and add (as a note) what you described here ("depend on commands executed in an EXIT trap").

Don Cragun

2010-07-29 15:39

manager   bugnote:0000481

Make the changes noted in 0000280:0000457.

Note to editor: Apply this change after making the changes specified in 0000155.

Issue History

Date Modified Username Field Change
2010-07-08 00:25 calestyo New Issue
2010-07-08 00:25 calestyo Status New => Under Review
2010-07-08 00:25 calestyo Assigned To => ajosey
2010-07-08 00:25 calestyo Name => Christoph Anton Mitterer
2010-07-08 00:25 calestyo Section => set built-in utility
2010-07-08 00:25 calestyo Page Number => none
2010-07-08 00:25 calestyo Line Number => none
2010-07-08 05:40 Don Cragun Page Number none => 2358-2359
2010-07-08 05:40 Don Cragun Line Number none => 74545-74548,74590-74591
2010-07-08 05:40 Don Cragun Interp Status => ---
2010-07-08 09:10 geoffclare Note Added: 0000457
2010-07-12 21:46 calestyo Note Added: 0000461
2010-07-29 15:39 Don Cragun Final Accepted Text => See 0000280:0000457
2010-07-29 15:39 Don Cragun Note Added: 0000481
2010-07-29 15:39 Don Cragun Status Under Review => Resolved
2010-07-29 15:39 Don Cragun Resolution Open => Accepted As Marked
2010-07-29 15:40 Don Cragun Final Accepted Text See 0000280:0000457 => See 0000280:0000481
2010-08-27 11:16 ajosey Tag Attached: tc1-2008
2012-05-11 08:08 geoffclare Relationship added related to 0000155
2012-05-11 08:09 geoffclare Relationship added related to 0000559
2013-04-16 13:06 ajosey Status Resolved => Closed