summaryrefslogtreecommitdiff
path: root/shell/hush_test/hush-trap
diff options
context:
space:
mode:
Diffstat (limited to 'shell/hush_test/hush-trap')
-rw-r--r--shell/hush_test/hush-trap/signal_read1.right1
-rwxr-xr-xshell/hush_test/hush-trap/signal_read1.tests5
-rw-r--r--shell/hush_test/hush-trap/signal_read2.right2
-rwxr-xr-xshell/hush_test/hush-trap/signal_read2.tests7
4 files changed, 15 insertions, 0 deletions
diff --git a/shell/hush_test/hush-trap/signal_read1.right b/shell/hush_test/hush-trap/signal_read1.right
new file mode 100644
index 0000000..2870a8e
--- /dev/null
+++ b/shell/hush_test/hush-trap/signal_read1.right
@@ -0,0 +1 @@
+Got HUP:0
diff --git a/shell/hush_test/hush-trap/signal_read1.tests b/shell/hush_test/hush-trap/signal_read1.tests
new file mode 100755
index 0000000..1105479
--- /dev/null
+++ b/shell/hush_test/hush-trap/signal_read1.tests
@@ -0,0 +1,5 @@
+(sleep 1; kill -HUP $$) &
+trap 'echo "Got HUP:$?"; exit' HUP
+while true; do
+ read ignored
+done
diff --git a/shell/hush_test/hush-trap/signal_read2.right b/shell/hush_test/hush-trap/signal_read2.right
new file mode 100644
index 0000000..71a6bc1
--- /dev/null
+++ b/shell/hush_test/hush-trap/signal_read2.right
@@ -0,0 +1,2 @@
+HUP
+Done:129
diff --git a/shell/hush_test/hush-trap/signal_read2.tests b/shell/hush_test/hush-trap/signal_read2.tests
new file mode 100755
index 0000000..eab5b9b
--- /dev/null
+++ b/shell/hush_test/hush-trap/signal_read2.tests
@@ -0,0 +1,7 @@
+$THIS_SH -c '
+(sleep 1; kill -HUP $$) &
+while true; do
+ read ignored
+done
+'
+echo "Done:$?"