[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: questions about coproc
From: |
alex xmb ratchev |
Subject: |
Re: questions about coproc |
Date: |
Thu, 9 Mar 2023 23:05:30 +0100 |
On Thu, Mar 9, 2023, 9:05 PM Greg Wooledge <greg@wooledge.org> wrote:
> 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.
>
.. i never listened to this untrue line
what the nonsense
>