> 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 chet@case.edu http://tiswww.tis.case.edu/~chet/