On 10/12/12 5:36 PM, Wladimir Sidorenko wrote: > 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.
The case where PIPESTATUS stores only a single exit status is the degenerate case. Pipelines have multiple elements. What do you think should happen in the following case? ! exit 1 | exit 2 | exit 3 $? reflects only the status of the pipeline, which in this case is the (inverted) status of the final command. Why should $PIPESTATUS not reflect the actual exit statuses? 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/