Anonymous | Login | 2023-12-01 06:31 UTC |
Main | My View | View Issues | Change Log | Docs |
Viewing Issue Simple Details [ Jump to Notes ] | [ Issue History ] [ Print ] | ||||||
ID | Category | Severity | Type | Date Submitted | Last Update | ||
0001247 | [1003.1(2016/18)/Issue7+TC2] Shell and Utilities | Editorial | Error | 2019-04-19 02:08 | 2019-11-19 16:17 | ||
Reporter | kre | View Status | public | ||||
Assigned To | |||||||
Priority | normal | Resolution | Accepted | ||||
Status | Applied | ||||||
Name | Robert Elz | ||||||
Organization | |||||||
User Reference | |||||||
Section | 2.12 | ||||||
Page Number | 2382 | ||||||
Line Number | 76195-6, 76201-2 | ||||||
Interp Status | --- | ||||||
Final Accepted Text | |||||||
Summary | 0001247: subshell execution environment and traps | ||||||
Description |
XCU 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 Action |
In 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". |
||||||
Tags | tc3-2008 | ||||||
Attached Files | |||||||
|
There are no notes attached to this issue. |
Mantis 1.1.6[^] Copyright © 2000 - 2008 Mantis Group |