Using set -x
in bash prints the shell-expanded commands to stderr.
I would like to redirect these to a file or pipe.
But not the whole output - only some commands.
Something like:
set -x command.txt ### <-- command.txt param is made up
echo $A $B
set +x
This would put the debug output to command. txt.
Can this be done?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…