aboutsummaryrefslogtreecommitdiff
path: root/shell/hush_test/hush-trap/signal7.tests
diff options
context:
space:
mode:
Diffstat (limited to 'shell/hush_test/hush-trap/signal7.tests')
-rwxr-xr-xshell/hush_test/hush-trap/signal7.tests18
1 files changed, 18 insertions, 0 deletions
diff --git a/shell/hush_test/hush-trap/signal7.tests b/shell/hush_test/hush-trap/signal7.tests
new file mode 100755
index 000000000..c2b1381f9
--- /dev/null
+++ b/shell/hush_test/hush-trap/signal7.tests
@@ -0,0 +1,18 @@
1bug() {
2 trap : exit
3 # Bug was causing sh to be run in subshell,
4 # as if this line is replaced with (sh -c ...; exit $?) &
5 # here:
6 sh -c 'echo REAL_CHILD=$$' &
7 echo PARENTS_IDEA_OF_CHILD=$!
8 wait # make sure bkgd shell completes
9}
10
11bug | {
12while read varval; do
13 eval $varval
14done
15test x"$REAL_CHILD" != x"" \
16&& test x"$REAL_CHILD" = x"$PARENTS_IDEA_OF_CHILD"
17echo "Bug detected: $?"
18}