[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Help-bash] BASH_XTRACEFD on stdout
From: |
Matthew Lenz |
Subject: |
[Help-bash] BASH_XTRACEFD on stdout |
Date: |
Thu, 15 Mar 2018 08:59:51 -0500 |
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?
- [Help-bash] BASH_XTRACEFD on stdout,
Matthew Lenz <=