[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 chet@case.edu http://cnswww.cns.cwru.edu/~chet/
- feature request: more complete set -e, Marc Weber, 2009/06/22
- Re: feature request: more complete set -e,
Chet Ramey <=
- Re: feature request: more complete set -e, Marc Weber, 2009/06/24
- Re: feature request: more complete set -e, Chet Ramey, 2009/06/25
- Re: feature request: more complete set -e, Marc Weber, 2009/06/28
- Re: feature request: more complete set -e, Greg Wooledge, 2009/06/29
- Re: feature request: more complete set -e, Chet Ramey, 2009/06/29
- Re: feature request: more complete set -e, Bob Proulx, 2009/06/29
- Re: feature request: more complete set -e, Marc Weber, 2009/06/30
- Re: feature request: more complete set -e, Greg Wooledge, 2009/06/30
- Re: feature request: more complete set -e, Chet Ramey, 2009/06/30