A NOTE has been added to this issue. ====================================================================== https://austingroupbugs.net/view.php?id=1876 ====================================================================== Reported By: calestyo Assigned To: ====================================================================== Project: 1003.1(2024)/Issue8 Issue ID: 1876 Category: Shell and Utilities Type: Clarification Requested Severity: Editorial Priority: normal Status: New Name: Christoph Anton Mitterer Organization: User Reference: Section: 2.15 Special Built-In Utilities Page Number: 2554 Line Number: 83295, ff. Interp Status: --- Final Accepted Text: ====================================================================== Date Submitted: 2024-11-18 23:54 UTC Last Modified: 2024-11-19 15:42 UTC ====================================================================== Summary: clarify, whether a trap action that is executed from a context where set -e is ignored, would have set -e ignored, too ======================================================================
---------------------------------------------------------------------- (0006964) calestyo (reporter) - 2024-11-19 15:42 https://austingroupbugs.net/view.php?id=1876#c6964 ---------------------------------------------------------------------- Well it doesn't specifically say that it's about the *whole* command, and even if, the term "whole command" would also be a bit ambiguous. Is a simple command by itself a whole command, when e.g. part of a list, function, etc.? Also, 2.9 Shell Commands says: >A command is one of the following: > Simple command (see 2.9.1 Simple Commands ) > Pipeline (see 2.9.2 Pipelines ) > List compound-list (see 2.9.3 Lists ) > Compound command (see 2.9.4 Compound Commands ) > Function definition (see 2.9.5 Function Definition Command ) 2.9.3 Lists in turn says: > The term "compound-list" is derived from the grammar > in 2.10 Shell Grammar ; it is equivalent to a sequence > of lists, separated by <newline> characters, that can > be preceded or followed by an arbitrary number of > <newline> characters. Wouldn't that mean that something like: sleep 100 || : sleep 50 is also, both together, a command (two lists separate by newline)? But I'd guess the intention is that the trap action is executed after the : but before the sleep 50, right? Also, are you sure the : is still executed? Change the example to: set -e foo() { echo a; false; echo b; } trap -- "echo INT; foo" INT sleep 100 || printf end and neither dash nor bash print end after Ctrl-C. Issue History Date Modified Username Field Change ====================================================================== 2024-11-18 23:54 calestyo New Issue 2024-11-18 23:54 calestyo Name => Christoph Anton Mitterer 2024-11-18 23:54 calestyo Section => 2.15 Special Built-In Utilities 2024-11-18 23:54 calestyo Page Number => 2554 2024-11-18 23:54 calestyo Line Number => 83295, ff. 2024-11-19 10:45 geoffclare Note Added: 0006962 2024-11-19 15:42 calestyo Note Added: 0006964 ======================================================================
