Configuration Information [Automatically generated, do not change]: Machine: i686 OS: linux-gnu Compiler: gcc Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='i686' -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i686-pc-linux-gnu' -DCONF_VENDOR='pc' -DLOCALEDIR='/usr/local/share/locale' -DPACKAGE='bash' -DSHELL -DHAVE_CONFIG_H -I. -I. -I./include -I./lib -g -O2 uname output: Linux Knoppix 2.6.12 #2 SMP Tue Aug 9 23:20:52 CEST 2005 i686 GNU/Linux Machine Type: i686-pc-linux-gnu
Bash Version: 3.1 Patch Level: 0 Release Status: release Description: In the included script, BASH_LINENO[0] within trap is allways the ending line of the enclosing compound command, instead of the line which caused the trap. Is this the intended behaviour, and if yes, is there any way to know within the trap the linenumber which caused the trap? Repeat-By: Repeat by running this script. echo $BASH_VERSION mytrap() { echo "ERR @ ${BASH_LINENO[0]}" } trap mytrap ERR { false # <-- I want this linenumber true } # <-- this line is reported while true ; do false # <-- I want this linenumber true break done # <-- this line is reported ( trap mytrap ERR false # <-- I want this linenumber true ) # <-- this line is reported -- Markus Laire _______________________________________________ Bug-bash mailing list Bug-bash@gnu.org http://lists.gnu.org/mailman/listinfo/bug-bash