bug-bash
[Top][All Lists]
Advanced

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

Re: Examples of concurrent coproc usage?


From: Zachary Santer
Subject: Re: Examples of concurrent coproc usage?
Date: Mon, 15 Apr 2024 23:25:26 -0400

On Mon, Apr 15, 2024 at 1:57 PM Carl Edquist <edquist@cs.wisc.edu> wrote:
>
> the thing discussed in my last email to the list (about
> coproc fds being set close-on-exec) makes them unusable for anything
> beyond stdin/stdout/stderr.
>
> [It might sound like an obscure use case, but once you realize what you
> can do with it, it becomes the main use case.]

>From what Chet was saying, I thought something like this would still work:

$ exec {cat}> >( cat; )
$ coproc tee { { tee /dev/fd/${cat2}; } {cat2}>&"${cat}"; }
[2] 1952
tee: /dev/fd/11: No such file or directory

Just dup another fd without using exec, and then use that. Evidently
not. Evidence for what you thought was actually going on I guess.

As much as you can just printf the same thing once for each fd, that
doesn't work super well for binary data.

I've thought about splitting and recombining pipelines like this, but
I've never had a reason to.



reply via email to

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