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.htmlhttps://lists.gnu.org/archive/html/help-bash/2021-03/msg00207.htmlhttps://lists.gnu.org/archive/html/help-bash/2022-11/msg00007.html
--
vq