aboutsummaryrefslogtreecommitdiffstats
path: root/tests/set-x1.sub
diff options
context:
space:
mode:
Diffstat (limited to 'tests/set-x1.sub')
-rw-r--r--tests/set-x1.sub25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/set-x1.sub b/tests/set-x1.sub
new file mode 100644
index 0000000..b2aa216
--- /dev/null
+++ b/tests/set-x1.sub
@@ -0,0 +1,25 @@
+: ${TMPDIR:=/var/tmp}
+TRACEFILE=$TMPDIR/bash-trace-$$
+trap 'rm -f $TRACEFILE' 0 1 2 3 6 15
+
+exec 4>$TRACEFILE
+BASH_XTRACEFD=4
+
+set -x
+
+echo 1
+echo 2
+echo 3
+echo 4
+
+unset BASH_XTRACEFD
+
+for f in a b c d e; do echo $f ; done
+
+set +x
+
+echo TRACEFILE:
+cat $TRACEFILE
+echo =====
+
+exit 0