bug-bash
[Top][All Lists]
Advanced

[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 2.0.0.21 (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."

http://www.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_09_04_03

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

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




reply via email to

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