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

Mon May 30 16:24:19 UTC 2011
Robert Nichols <rnicholsNOSPAM at comcast.net>

On 05/30/2011 10:00 AM, Dotan Cohen wrote:
> On Mon, May 30, 2011 at 17:55, Bob Beers<bob.beers at gmail.com>  wrote:
>> You can check the return code.
>>
>> $ ls
>> $ echo $?
>>
>> 0 (usually) indicates success.
>>
>
> Thank you Bob, that is exactly what I was looking for!

And when you have several commands in a pipeline, the PIPESTATUS array
is your friend:

     $ true | false | false | true | true
     $ echo ${PIPESTATUS[*]}
     0 1 1 0 0

-- 
Bob Nichols     "NOSPAM" is really part of my email address.
                 Do NOT delete it.