Configuration Information [Automatically generated, do not change]:
Machine: i386
OS: freebsd6.2
Compiler: cc
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='i386' -DCONF_OSTYPE='
freebsd6.2' -DCONF_MACHTYPE='i386-portbld-freebsd6.2' -D
CONF_VENDOR='portbld' -DLOCALEDIR='/usr/local/share/locale' -DPACKAGE='bash'
-DSHELL  -DHAVE_CONFIG_H   -I.  -I. -I./include -I./lib
  -I/usr/local/include -O2 -fno-strict-aliasing -pipe
uname output: FreeBSD log1.ops.lfc.qihoo.net 6.2-RELEASE FreeBSD
6.2-RELEASE#0: Thu Dec  6 15:15:26 CST 2007
[EMAIL PROTECTED]
qihoo.net:/usr/obj/usr/src/sys/GENERIC  i386
Machine Type: i386-portbld-freebsd6.2

Bash Version: 3.1
Patch Level: 17
Release Status: release


Description:
for example,I have a shell script test.sh

#############cat test.sh
test="mama";
test1="";
echo "test is $test";

[  !  "$test"  -a "$test1"  ] && test="papa";

echo "test is $test";
###########script end

if i use sh,the result which is I wanted,is :
[EMAIL PROTECTED] sh test1.sh
test is mama
test is mama

if i use bash, the result is :
[EMAIL PROTECTED] bash test1.sh
test is mama
test is papa

I think ,this is a bug in bash.and i test it on many freebsd release 4.11,
6.1,6.2 with default bash version,this is same.

Reply via email to