bug-bash
[Top][All Lists]
Advanced

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

set -e's bug


From: Hiroshi Fujishima
Subject: set -e's bug
Date: Wed, 7 May 2008 14:16:14 +0900 (JST)

Configuration Information [Automatically generated, do not change]:
Machine: i386
OS: freebsd7.0
Compiler: cc
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='i386' 
-DCONF_OSTYPE='freebsd7.0' -DCONF_MACHTYPE='i386-portbld-freebsd7.0' 
-DCONF_VENDOR='portbld' -DLOCALEDIR='/usr/local/share/locale' -DPACKAGE='bash' 
-DSHELL  -DHAVE_CONFIG_H   -I.  -I. -I./include -I./lib  -I/usr/local/include 
-O2 -fno-strict-aliasing -pipe
uname output: FreeBSD yamato.tonteki.org 7.0-RELEASE FreeBSD 7.0-RELEASE #0: 
Sun Feb 24 19:59:52 UTC 2008     address@hidden:/usr/obj/usr/src/sys/GENERIC  
i386
Machine Type: i386-portbld-freebsd7.0

Bash Version: 3.2
Patch Level: 39
Release Status: release

Description:

Executing the following script.  It exits at `until command false'.

------------------------
set -e
until command false; do
    break
done
echo ok
------------------------

(info "(bash)The Set Builtin") has following description:
|     `-e'
|           Exit immediately if a simple command (*note Simple
|           Commands::) exits with a non-zero status, unless the command
|           that fails is part of the command list immediately following
|           a `while' or `until' keyword, part of the test in an `if'
|           statement, part of a `&&' or `||' list, or if the command's
|           return status is being inverted using `!'.  A trap on `ERR',
|           if set, is executed before the shell exits.

Repeat-By:

% bash -ec 'until false; do break; done; echo ok'
ok
% bash -ec 'until command false; do break; done; echo ok'

% sh -ec 'until false; do break; done; echo ok'
ok
% sh -ec 'until command false; do break; done; echo ok'
ok

% zsh -ec 'until false; do break; done; echo ok'
ok
% zsh -ec 'until command false; do break; done; echo ok'
ok




reply via email to

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