[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: coprocesses *can* be more than one at a time
From: |
Lawrence Velázquez |
Subject: |
Re: coprocesses *can* be more than one at a time |
Date: |
Sun, 29 Jan 2023 21:01:41 -0500 |
User-agent: |
Cyrus-JMAP/3.9.0-alpha0-85-gd6d859e0cf-fm-20230116.001-gd6d859e0 |
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