[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: PIPESTATUS within assignment statements.
From: |
Chet Ramey |
Subject: |
Re: PIPESTATUS within assignment statements. |
Date: |
Wed, 11 Oct 2006 13:53:59 -0400 |
> 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/