[Top][All Lists]

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

set -e, but test return not honoured _conditionally_

From: Steffen Daode Nurpmeso
Subject: set -e, but test return not honoured _conditionally_
Date: Fri, 18 Feb 2011 16:36:06 +0100
User-agent: Mutt/1.5.21 (2010-09-15)

Configuration Information [Automatically generated, do not change]:
Machine: i386
OS: darwin10.0
Compiler: gcc
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='i386' 
-DCONF_OSTYPE='darwin10.0' -DCONF_MACHTYPE='i386-apple-darwin10.0' 
-DCONF_VENDOR='apple' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='bash' -DSHELL 
-DHAVE_CONFIG_H -DMACOSX   -I.  -I/SourceCache/bash/bash-80/bash 
-I/SourceCache/bash/bash-80/bash/include -I/SourceCache/bash/bash-80/bash/lib 
-I/SourceCache/bash/bash-80/bash/lib/intl -I/var/tmp/bash/bash-80~440/lib/intl  
-arch x86_64 -arch i386 -g -Os -pipe -no-cpp-precomp -mdynamic-no-pic -DM_UNIX 
uname output: Darwin sherwood.local 10.6.0 Darwin Kernel Version 10.6.0: Wed 
Nov 10 18:13:17 PST 2010; root:xnu-1504.9.26~3/RELEASE_I386 i386
Machine Type: i386-apple-darwin10.0

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

I am not a sophisticated shell programmer, but i really think this
time it's a shell fault.
You may invoke the code snippet via 'script test1 test3' or so.

        set -e

        _t() {
            echo "Entry _t for $CURR"
            test "$PARAMS" != "${PARAMS/$CURR/}" && { return; }
            # Uncomment the next line and the script won't fail!
            #echo "Exit _t for $CURR"


        CURR='test1'   _t
        CURR='test2'   _t
        CURR='test3'   _t

reply via email to

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