help-bash
[Top][All Lists]
Advanced

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

Re: questions about coproc


From: Greg Wooledge
Subject: Re: questions about coproc
Date: Thu, 9 Mar 2023 15:04:41 -0500

On Thu, Mar 09, 2023 at 03:00:02PM -0500, Grisha Levit wrote:
> On Thu, Mar 9, 2023, 14:34 Grisha Levit <grishalevit@gmail.com> wrote:
> 
> > On Thu, Mar 9, 2023, 13:48 Britton Kerin <britton.kerin@gmail.com> wrote:
> >
> >> 1.  no obvious way to propagate e.g. the die argument in the above
> >> back to the controlling terminal.
> >
> >
> > Maybe you mean something else by "propagate"
> >
> 
> Oh, if you mean capturing the stderr output (without a temp file) you can
> use another coproc for that.
> 
> $ coproc e { read -r && echo "$REPLY"; }
> $ coproc c { echo err >&2; } 2>&${e[1]}
> $ read -ru ${e[0]} && echo "$REPLY"
> err

How is that supposed to work when the manual specifically says

       There may be only one active coprocess at a time.



reply via email to

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