Ok, thanks. I'll notice this for the future. It's of course arguable, whether PIPESTATUS stores a true value, since the '!' inversion keyword gets ignored in this case. But if it was intended, than it's ok.
2012/10/13 Chet Ramey <chet.ra...@case.edu>: > On 10/10/12 10:38 AM, Wladimir Sidorenko wrote: >> Dear all, >> >> After running the following command: >> >> $ ! test 0 -eq 0 >> >> I can see different exit codes in $? and ${PIPESTATUS[@]}. Here, what I get >> >> $ ! test 1 -eq 0 ; echo $? ${PIPESTATUS[@]} >> 0 1 >> >> $ ! test 0 -eq 0 ; echo $? ${PIPESTATUS[@]} >> 1 0 >> >> I'd like to know whether that's a desired behavior or a bug. > > The current behavior is the intended behavior. PIPESTATUS reflects the > "true" return status(es) of the process(es) in the pipeline, before any > inversion of the pipeline's exit status. That's what seems the most > useful. > > Chet > > -- > ``The lyf so short, the craft so long to lerne.'' - Chaucer > ``Ars longa, vita brevis'' - Hippocrates > Chet Ramey, ITS, CWRU c...@case.edu http://cnswww.cns.cwru.edu/~chet/