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, sch...@linux-m68k.org GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1 "And now for something completely different."