bug-bash
[Top][All Lists]
Advanced

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

wrong status from exit in trap


From: Gregg Townsend
Subject: wrong status from exit in trap
Date: Thu, 16 Oct 2003 15:04:13 -0700

Configuration Information [Automatically generated, do not change]:
Machine: i386
OS: linux-gnu
Compiler: i386-redhat-linux-gcc
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='i386' 
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i386-redhat-linux-gnu' 
-DCONF_VENDOR='redhat' -DSHELL -DHAVE_CONFIG_H  -I.  -I. -I./include -I./lib 
-D_GNU_SOURCE  -O2 -g -pipe -march=i386 -mcpu=i686
uname output: Linux huron 2.4.20-8 #1 Thu Mar 13 17:54:28 EST 2003 i686 i686 
i386 GNU/Linux
Machine Type: i386-redhat-linux-gnu

Bash Version: 2.05b
Patch Level: 0
Release Status: release

Description:
        According to POSIX, an exit command within a trap should use
        the status of the last command preceding the trap if no value
        is specified.  However, it appears that bash is using the
        status of the last command within the trap.

Repeat-By:
        Copy the three commands below to a file, and run it.
        Check the exit status with "echo $?".  It should be 1, not 0.

        set -x -e
        trap 'true; exit' 0
        false





reply via email to

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