[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Possible bug in bash error reporting
From: |
Jan Schampera |
Subject: |
Possible bug in bash error reporting |
Date: |
Sun, 31 Jul 2005 10:38:12 +0200 |
Configuration Information [Automatically generated, do not change]:
Machine: i586
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='i586'
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i586-mandrake-linux-gnu'
-DCONF_VENDOR='mandrake' -DLOCALEDIR='/usr/share/locale'
-DPACKAGE='bash' -DSHELL -DHAVE_CONFIG_H -I. -I.. -I../include
-I../lib -D_GNU_SOURCE -O2 -fomit-frame-pointer -pipe -march=i586
-mtune=pentiumpro uname output: Linux mainserver 2.6.11.11 #1 Sat Jun 4
00:31:34 CEST 2005 i686 AMD Sempron(TM) 2800+ unknown GNU/Linux Machine
Type: i586-mandrake-linux-gnu
Bash Version: 3.0
Patch Level: 13
Release Status: release
Description:
Say, you have a file, A.sh, and source another file, B.sh, all
errors in B.sh are reported with the line number of B.sh. BUT: it seems
that only internal (parser? interpreter?) errors are reported mentioning
B.sh. Errors generated by builtins and errors during the execution of a
program just come up with only the linenumber. Also present in 2.x
versions.
Repeat-By:
A.sh
----
#!/bin/sh
echo "we're on line $LINENO"
echo "about to source B.sh"
source B.sh
echo "finished sourcing B.sh"
B.sh
----
echo "first line of B.sh. next line has an error.. were in $LINENO"
/ubin/[
# try that with '()' or whatever keyword, too
echo "third line of B.sh"
[bonsai@mainserver tests]$./A.sh
we're on line 3
about to source B.sh
first line of B.sh. next line has an error.. were in 1
./A.sh: line 2: /ubin/[: No such file or directory
third line of B.sh
finished sourcing B.sh
--
I know life sometimes can get tough! and I know life sometimes can be a
drag! But people, we have been given a gift, we have been given a road
And that roads name is... rock and roll!
KISS in "God gave Rock'n'Roll to you"
- Possible bug in bash error reporting,
Jan Schampera <=