summaryrefslogtreecommitdiffstats
path: root/test/bashisms/traps.sh
diff options
context:
space:
mode:
Diffstat (limited to 'test/bashisms/traps.sh')
-rw-r--r--test/bashisms/traps.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/bashisms/traps.sh b/test/bashisms/traps.sh
new file mode 100644
index 0000000..b357ce7
--- /dev/null
+++ b/test/bashisms/traps.sh
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+trap foo ERR # BASHISM
+trap foo RETURN # BASHISM
+trap foo DEBUG # BASHISM
+
+trap "echo BASHISM" ERR
+trap "echo BASHISM" RETURN
+trap "echo BASHISM" DEBUG
+
+foo() {
+ echo ": dummy function"
+}
+
+trap $(foo BASHISM) ERR
+trap "$(foo BASHISM)" RETURN
+trap "echo $foo BASHISM" DEBUG