summaryrefslogtreecommitdiff
path: root/shell/ash_test/ash-signals/usage.right
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2023-03-30 11:05:04 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2023-03-31 14:22:56 +0200
commit098cd7ece44bf7ab7ae38dc00dd574af79a9bad8 (patch)
treeaf16f7162dc6a5bbcea8277528476859325d4cb7 /shell/ash_test/ash-signals/usage.right
parentaf5277f883e8fc2e0236aa9ecc5115ecaffd0ccb (diff)
downloadbusybox-098cd7ece44bf7ab7ae38dc00dd574af79a9bad8.tar.gz
ash: improve trap and jobs builtins in child shells
The trap and jobs builtins can be used to report information about traps and jobs. This works when they're called from the current shell but in a child shell the required information is usually cleared. Special hacks allow: - trap to work with command substitution; - jobs to work with command substitution or in a pipeline. Neither works with process substitution. - Relax the test for the trap hack so it also supports pipelines. - Pass the command to be evaluated to forkshell() in evalbackcmd() so trap and jobs both work with process substitution. function old new delta forkchild 629 640 +11 argstr 1502 1496 -6 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/1 up/down: 11/-6) Total: 5 bytes Signed-off-by: Ron Yorston <rmy@pobox.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'shell/ash_test/ash-signals/usage.right')
-rw-r--r--shell/ash_test/ash-signals/usage.right12
1 files changed, 12 insertions, 0 deletions
diff --git a/shell/ash_test/ash-signals/usage.right b/shell/ash_test/ash-signals/usage.right
index c0dbd6c3c..df1ed2dd7 100644
--- a/shell/ash_test/ash-signals/usage.right
+++ b/shell/ash_test/ash-signals/usage.right
@@ -6,6 +6,18 @@ trap -- 'a' INT
trap -- 'a' USR1
trap -- 'a' USR2
___
+trap -- 'a' EXIT trap -- 'a' INT trap -- 'a' USR1 trap -- 'a' USR2
+___
+trap -- 'a' EXIT
+trap -- 'a' INT
+trap -- 'a' USR1
+trap -- 'a' USR2
+___
+trap -- 'a' EXIT
+trap -- 'a' INT
+trap -- 'a' USR1
+trap -- 'a' USR2
+___
___
trap -- 'a' USR1
trap -- 'a' USR2