help-bash
[Top][All Lists]
Advanced

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

Re: coprocesses *can* be more than one at a time


From: Nikolaos Kakouros
Subject: Re: coprocesses *can* be more than one at a time
Date: Mon, 30 Jan 2023 02:08:09 +0000

Oh, should have searched better. Thank you for the links.

________________________________
From: Lawrence Velázquez <vq@larryv.me>
Sent: Monday, January 30, 2023 3:01:41 AM
To: Nikolaos Kakouros
Cc: help-bash@gnu.org
Subject: Re: coprocesses *can* be more than one at a time

On Sun, Jan 29, 2023, at 8:39 PM, Nikolaos Kakouros wrote:
> The man page for bash ends with the following sentence:
>
>     There may be only one active coprocess at a time.
>
> This (I assume) refers to `coproc`-created processes. But running the
> following does not result in error, only in a warning:
>
>     for i in {1..2}; do coproc test$i { for j in {1..4}; do echo
> "message from $i" >&2; sleep 1; done; }; done
>
> The messages are printed fine in stderr, the `$test1_PID`, `$test1`,
> `$test2_PID` and `$test2` variables are all correctly set and the
> warning says:
>
>     bash: warning: execute_coproc: coproc [3087474:test1] still exists
>
> Is the `may` in the man page quote meant to imply a warning instead of
> an error or should that quote be removed/rephrased? Also, what is the
> risk the warning is warning the user about?

Take a look at these past threads.

https://lists.gnu.org/archive/html/bug-bash/2011-04/msg00056.html
https://lists.gnu.org/archive/html/help-bash/2021-03/msg00207.html
https://lists.gnu.org/archive/html/help-bash/2022-11/msg00007.html

--
vq


reply via email to

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