[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: feature request: more complete set -e

From: Chet Ramey
Subject: Re: feature request: more complete set -e
Date: Tue, 23 Jun 2009 09:00:10 -0400
User-agent: Thunderbird (Macintosh/20090302)

Marc Weber wrote:
> Hi,
> I stumbled about another bash problem today:
> for item in $(false);
>   echo $item
> done || { echo for failed; }
> doesn't fail. I think it's bad that there is no
>   set -e 
> like switch which really catches all failures of this kind.

This isn't really about set -e or ||; the for loop doesn't fail.

Posix.2 says, in part,

        "[T]he list of words following in shall be expanded to generate
         a list of items...If there are no items, the exit status shall
         be zero."


``The lyf so short, the craft so long to lerne.'' - Chaucer

Chet Ramey, ITS, CWRU    chet@case.edu    http://cnswww.cns.cwru.edu/~chet/

reply via email to

[Prev in Thread] Current Thread [Next in Thread]