help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-bash] BASH_XTRACEFD on stdout


From: Greg Wooledge
Subject: Re: [Help-bash] BASH_XTRACEFD on stdout
Date: Thu, 15 Mar 2018 10:52:46 -0400
User-agent: NeoMutt/20170113 (1.7.2)

On Thu, Mar 15, 2018 at 08:59:51AM -0500, Matthew Lenz wrote:
> 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?

There may be some desynchronization of stdout's lines in the log since
they're being written by the tee process instead of by the script.
As far as I know, that's unavoidable, due to the complexity of your
desired setup.

If this is working as you desire (or close enough), then it seems OK.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]