bug-bash
[Top][All Lists]
Advanced

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

trap 'echo "trap exit on ${LINENO}"' EXIT -> wrong linenumber


From: Jochen Dekeyser
Subject: trap 'echo "trap exit on ${LINENO}"' EXIT -> wrong linenumber
Date: Tue, 14 Sep 2010 09:44:12 +0200

Configuration Information [Automatically generated, do not change]:
Machine: x86_64
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='x86_64'
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='x86_64-redhat-linux-gnu'
-DCONF_VENDOR='redhat' -DLOCALEDIR='/usr/share/locale'
-DPACKAGE='bash' -DSHELL -DHAVE_CONFIG_H   -I.  -I. -I./include
-I./lib  -D_GNU_SOURCE -DRECYCLES_PIDS  -O2 -g -pipe -Wall
-Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector
--param=ssp-buffer-size=4 -m64 -mtune=generic
uname output: Linux phanes 2.6.34.6-54.fc13.x86_64 #1 SMP Sun Sep 5
17:16:27 UTC 2010 x86_64 x86_64 x86_64 GNU/Linux
Machine Type: x86_64-redhat-linux-gnu

Bash Version: 4.1
Patch Level: 7
Release Status: release

Description:
        Run this script:

        #!/bin/bash

        trap 'echo "trap error on ${LINENO}"' ERR
        trap 'echo "trap exit on ${LINENO}"' EXIT

        /bin/false

        exit 0

        You should get (and this is also the result you get in Bash 3.2):

        trap error on 6
        trap exit on 8

        But you get:

        trap error on 6
        trap exit on 1


Repeat-By:
        Run the script! (See the description-section)



reply via email to

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