]> git.ipfire.org Git - thirdparty/bash.git/blobdiff - tests/set-x1.sub
Bash-4.2 distribution sources and documentation
[thirdparty/bash.git] / tests / set-x1.sub
diff --git a/tests/set-x1.sub b/tests/set-x1.sub
new file mode 100644 (file)
index 0000000..b2aa216
--- /dev/null
@@ -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