On Tue, Dec 11, 2012 at 02:31:28PM -0500, DJ Mills wrote:
>   First of all, the man page and help output state:
>     `The return status of a coprocess is the exit status of command.'
>   No matter what, coproc seems to always return true.
> 
>   To reproduce:
>     coproc false || echo error1 >&2; wait "$COPROC_PID" || echo error2 >&2

Since coproc creates a background job, it doesn't really makes sense that
the "coproc" command itself would know the exit status of the background
job.  It would have to wait for the background job to terminate first,
which would defeat the whole purpose.

So, I'd just call it a documentation flaw.  Most likely "coproc" is
indicating whether it successfully created the coprocess (bg job), and
you'll have to use "wait" to fetch its exit status once it becomes
available.

Reply via email to