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: Matthew Lenz
Subject: Re: [Help-bash] BASH_XTRACEFD on stdout
Date: Thu, 15 Mar 2018 10:23:49 -0500

On Thu, Mar 15, 2018 at 9:52 AM, Greg Wooledge wrote:

> 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.
>

Thanks.  My main concern was impacting the "communication" (piping) between
processes like I saw with setting it equal to 1 like I had originally.


reply via email to

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