View Issue Details

IDProjectCategoryView StatusLast Update
00012471003.1(2016/18)/Issue7+TC2Shell and Utilitiespublic2024-06-11 09:08
Reporterkre Assigned To 
PrioritynormalSeverityEditorialTypeError
Status ClosedResolutionAccepted 
NameRobert Elz
Organization
User Reference
Section2.12
Page Number2382
Line Number76195-6, 76201-2
Interp Status---
Final Accepted Text
Summary0001247: subshell execution environment and traps
DescriptionXCU 2.12 (lines 76195-6) says:

     A subshell environment shall be created as a duplicate of
     the shell environment, except that signal traps that are
     not being ignored shall be set to the default action.

The issue is the word "signal" which could be read to imply that
EXIT traps (EXIT not being a signal) should not be reset to the
default in a subshell environment. No shell I have tested works
like that (nor would anyone expect, or want, them to). Less shells
support other non-signal traps, but the ones I have tested that
support ERR traps do not execute one of those set in the parent
shell when running in a subshell environment either. (I tested
numerous ways of producing a sub-shell environment for testing
EXIT traps, and none of them ran the trap, in any shell I tested.)

While in this paragraph, note that it ends (lines 76201-2) with
the sentence:

    All other commands shall be executed in the current
    shell environment.

After having listed a selection of commands that do not
(or might not, in the case of pipes) run in the current
execution environment. Yet section 2.9 (line ) says:

   If there is no command name, any redirections shall be
   performed in a subshell environment;

which is an empty simple command with redirects. That case
is not mentioned in the list of cases which use a subshell
environment in 2.12, contradicting the "All other" words.

Rather than attempt to list every place where the standard
might now, or in the future, require a sub-shell environment,
a better solution might just be to qualify the "All" to make
it clear than any other place the standard requires a subshell
environment is also to have one.

Desired ActionIn line 76196 delete the word "signal".

In line 76201, delete the word "All" at the beginning of
the sentence "All other commands..." and replace it with
"Except where otherwise stated, all".

Tagstc3-2008

Activities

There are no notes attached to this issue.

Issue History

Date Modified Username Field Change
2019-04-19 02:08 kre New Issue
2019-04-19 02:08 kre Name => Robert Elz
2019-04-19 02:08 kre Section => 2.12
2019-04-19 02:08 kre Page Number => 2382
2019-04-19 02:08 kre Line Number => 76195-6, 76201-2
2019-06-27 16:10 Don Cragun Interp Status => ---
2019-06-27 16:10 Don Cragun Status New => Resolved
2019-06-27 16:10 Don Cragun Resolution Open => Accepted
2019-06-27 16:10 Don Cragun Tag Attached: tc3-2008
2019-11-19 16:17 geoffclare Status Resolved => Applied
2024-06-11 09:08 agadmin Status Applied => Closed