I have a bash script and I want to capture a portion of the script with a set -x and redirect that output to a file.
I can see what the ENVFILE is setting but its going to std out.
Is there a way I can capture the output of the set -x into a file instead of std out ?
#!/bin/sh
...a bunch of stuff....
if [ -e ${ENVFILE} ]; then
set -x
. ${ENVFILE}
set +x
fi # ! -e PROJOB
... a bunch of stuff ....