Austin Group Defect Tracker

Aardvark Mark IV


Viewing Issue Simple Details Jump to Notes ] Issue History ] Print ]
ID Category Severity Type Date Submitted Last Update
0001384 [1003.1(2016)/Issue7+TC2] Shell and Utilities Objection Omission 2020-07-29 09:02 2020-07-29 09:02
Reporter geoffclare View Status public  
Assigned To
Priority normal Resolution Open  
Status New  
Name Geoff Clare
Organization The Open Group
User Reference
Section 2.12 Shell Execution Environment
Page Number 2382
Line Number 76195-76202
Interp Status ---
Final Accepted Text
Summary 0001384: Subshell of an interactive shell is effectively non-interactive
Description The standard is missing a statement to the effect that a subshell of an interactive shell behaves as a non-interactive shell (despite the fact that $- and "set +o" indicate it is interactive).

For example, in all shells I tried, the subshell in the following is terminated by SIGTERM. (Some wrote "Terminated" between the two lines, others didn't, but the $? value in all of them indicated termination with SIGTERM and none of them wrote "foo".)
$ (pid=$(sh -c 'echo $PPID'); kill -s TERM "$pid"; echo foo)
$ echo $?
If the subshell was behaving as per the standard's requirements for an interactive shell, the SIGTERM would be ignored, the echo would be executed, and $? would be 0.

The current statement about traps in 2.12 is also out of date with respect to the description of the trap utility.
Desired Action On page 2382 line 76195 section 2.12 Shell Execution Environment,
after applying bug 1247 change:
A subshell environment shall be created as a duplicate of the shell environment, except that traps that are not being ignored shall be set to the default action.
to:
A subshell environment shall be created as a duplicate of the shell environment, except that:
  • Unless specified otherwise (see [xref to trap]), traps that are not being ignored shall be set to the default action.

  • If the shell is interactive, the subshell shall behave as a non-interactive shell in all respects other than the expansion of the special parameter '-' and the output of <tt>set -o</tt> and <tt>set +o</tt>, which shall continue to indicate that it is interactive.

Tags No tags attached.
Attached Files

- Relationships

There are no notes attached to this issue.

- Issue History
Date Modified Username Field Change
2020-07-29 09:02 geoffclare New Issue
2020-07-29 09:02 geoffclare Name => Geoff Clare
2020-07-29 09:02 geoffclare Organization => The Open Group
2020-07-29 09:02 geoffclare Section => 2.12 Shell Execution Environment
2020-07-29 09:02 geoffclare Page Number => 2382
2020-07-29 09:02 geoffclare Line Number => 76195-76202
2020-07-29 09:02 geoffclare Interp Status => ---


Mantis 1.1.6[^]
Copyright © 2000 - 2008 Mantis Group
Powered by Mantis Bugtracker