[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Bug in [ error reporting
From: |
nick |
Subject: |
Bug in [ error reporting |
Date: |
Sun, 31 Jul 2005 03:39:05 -0500 |
User-agent: |
Internet Messaging Program (IMP) H3 (4.0) |
Configuration Information [Automatically generated, do not change]:
Machine: i386
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='i386'
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i386-pc-linux-gnu'
-DCONF_VENDOR='pc' -DSHELL -DHAVE_CONFIG_H -I. -I../bash -I../bash/include
-I../bash/lib -g -O2
uname output: Linux client1 2.6.8-2-386 #1 Thu May 19 17:40:50 JST 2005 i686
GNU/Linux
Machine Type: i386-pc-linux-gnu
Bash Version: 2.05b
Patch Level: 0
Release Status: release
Description:
The [ command error reporting can incorrectly state which file an error
occured in.
Repeat-By:
Create A.sh:
#!/bin/sh
echo "about to source B.sh"
source B.sh
echo "finished sourcing B.sh"
Create B.sh:
#!/bin/sh
echo "first line of B.sh. next line has an error.."
[ 0 [
echo "after error-line"
Run A.sh:
nick@client1:~> ./A.sh
line 3 of A.sh. about to source B.sh
line 2 of B.sh. next line has an error..
./A.sh: line 3: [: missing `]'
after error-line
finished sourcing B.sh
nick@client1:~>
See that the error message says that the error occured on line 3 of A.sh,
when in fact the error occured on line 3 of B.sh
-Nick Hoffman
nick@deadorange.com
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Bug in [ error reporting,
nick <=