[CentOS] Getting the return value of the last command run

Stephen Harris lists at spuddy.org
Mon May 30 17:22:22 UTC 2011


On Mon, May 30, 2011 at 11:24:19AM -0500, Robert Nichols wrote:
>      $ true | false | false | true | true
>      $ echo ${PIPESTATUS[*]}
>      0 1 1 0 0

Note that this is bash-ism; don't depend on it in a POSIX environment!

-- 

rgds
Stephen



More information about the CentOS mailing list