Matthew Lenz
2018-03-15 13:59:51 UTC
I wasn't thinking and thought:
BASH_XTRACEFD=1
set -x
commands
wouldn't bite me, but of course it did (piping between commands)
I switched out to the following:
exec 4>&1
BASH_XTRACEFD=4
commands
The reason I'm doing this is because I have a cronjob that I'd like to do
the following:
script.sh 2>&1 >> logfile | tee -a logfile
This puts the stdout, debugging and stderr in my logfile but also allows
stderr to flow through in a mail notification.
It appears to not cause problems. Any reason to think otherwise?
BASH_XTRACEFD=1
set -x
commands
wouldn't bite me, but of course it did (piping between commands)
I switched out to the following:
exec 4>&1
BASH_XTRACEFD=4
commands
The reason I'm doing this is because I have a cronjob that I'd like to do
the following:
script.sh 2>&1 >> logfile | tee -a logfile
This puts the stdout, debugging and stderr in my logfile but also allows
stderr to flow through in a mail notification.
It appears to not cause problems. Any reason to think otherwise?