bug-bash
[Top][All Lists]
Advanced

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

Re: Unexpected behaviour when using process substitution with stdout and


From: Andreas Schwab
Subject: Re: Unexpected behaviour when using process substitution with stdout and stderr
Date: Sun, 11 Jul 2021 15:26:04 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)

On Jul 11 2021, Greg Wooledge wrote:

> You're sending the stderr of generate to a subshell where the stderr()
> function is executed.  But the stderr() function writes to stdout.
> Therefore, all of the output from generate is ultimately ending up going
> to the script's stdout, with potentially weird interleaving depending
> on the timing of the two background subshells.

There is no interleaving.  The output of stderr is connected to the
current disposition of fd 1 which is redirected to the >(stdout) pipe.
You can either switch the order of redirections, or save the previous
disposition of fd 1 in another fd and redirect the output of stderr
there.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."



reply via email to

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