Applied in this form:
preverrout_fd = 2;
+ if (BASH_XTRACEFD && xflag) {
+ /* NB: bash closes fd == $BASH_XTRACEFD when it is changed.
+* we do not emulate this. We only use its value.
+*/
+ const char *xtracefd =
There is a very useful feature in Bash where you can redirect the trace
enabled by `set -x` to a file descriptor *different* than 2. This comes
in particularly handy when validating the error output of commands, say,
in Git's test suite, while tracing at the same time.
It is such a useful