> a=$(COMMAND1 | COMMAND2 | COMMAND3)
> 
> How can I get return status from COMMAND2?

a=$(COMMAND1 | COMMAND2 | COMMAND3 ; exit ${PIPESTATUS[1]} )
c2exit=$?

This will get you what you want in the majority of cases.

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                                Live Strong.
Chet Ramey, ITS, CWRU    [EMAIL PROTECTED]    http://tiswww.tis.case.edu/~chet/


_______________________________________________
Bug-bash mailing list
Bug-bash@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-bash

Reply via email to