I have a bash script that has set -x in it. Is it possible to redirect the debug prints of this script and all its output to a file? Ideally I would like to do
set -x
the -x output goes to stderr, so to log it do:
-x
set -x exec 2>/tmp/mylog