Incompatibilities between 3.0x and 3.1x

2006-03-25 Thread agomez
Configuration Information [Automatically generated, do not change]:
Machine: i486
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='i486' 
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i486-pc-linux-gnu' 
-DCONF_VENDOR='pc' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='bash' -DSHELL 
-DHAVE_CONFIG_H   -I.  -I../bash -I../bash/include -I../bash/lib   -g -O2
uname output: Linux neutrino 2.6.12.4-bootsplash-mppe-squashfs-skas3-v8.2 #1 
Tue Aug 16 00:18:14 CEST 2005 i686 GNU/Linux
Machine Type: i486-pc-linux-gnu

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

Description:
I've found some of my old scripts result in a syntax error. I 
don't know if it's an error in the parser, the scripts or the bash 
options.

Repeat-By:
This fails in 3.1x but in 3.0x:

sh-3.1$ let HI=(16-10)/2
sh: let: /2: syntax error: operand expected (error token is 
"/2")

This works:

sh-3.1$ ((HOLA=(16-10)/2))

--

This fails in 3.1x but in 3.0x:

sh-3.1$ for i in 1 2 3; do echo ${TOKEN["$i"]}; done
sh: "1": syntax error: operand expected (error token is ""1"")

This works:

sh-3.1$ for i in 1 2 3; do echo ${TOKEN[$i]}; done






___
Bug-bash mailing list
Bug-bash@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-bash


$* and $@ broken on some (64 bit?) platforms in bash 3.1

2006-03-25 Thread Harald Koenig
Configuration Information [Automatically generated, do not change]:
Machine: powerpc
OS: darwin8.0
Compiler: gcc
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='powerpc' 
-DCONF_OSTYPE='darwin8.0' -DCONF_MACHTYPE='powerpc-apple-darwin8.3.0' 
-DCONF_VENDOR='apple' 
-DLOCALEDIR='/scr/vemac1/koenig/bash-3.1/PREINSTALL//usr/local//share/locale' 
-DPACKAGE='bash' -DSHELL -DHAVE_CONFIG_H -DMACOSX   -I.  -I. -I./include 
-I./lib -I./lib/intl -I/scr/vemac1/koenig/bash-3.1/ARENA/32/lib/intl  -O2 
-D_LARGE_FILES -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
uname output: Darwin vemac1 8.3.0 Darwin Kernel Version 8.3.0: Mon Oct  3 
20:04:04 PDT 2005; root:xnu-792.6.22.obj~2/RELEASE_PPC Power Macintosh powerpc
Machine Type: powerpc-apple-darwin8.3.0

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

Description:
$* and $@ show $1 (or $2, only on DEC Alpha) instead of " " (space) as 
separator of arguments.

I've tried both bash 3.1 patch level 5 and 14 on Mac OS X, no difference. 

bash 3.00.16(2)-release does not show this bug! 


Repeat-By:

./mactest.sh x y z
xxyxz
xxyxz
xxyxz
arg1 = x
arg2 = y

with the following script:

 8< --- 8< --- 8< --- 8< --- 8< --- 8< --- 8< 
#!/usr/local/bin/bash

echo $*
echo $@
echo "$@"

echo "arg1 = $1"
echo "arg2 = $2"
 8< --- 8< --- 8< --- 8< --- 8< --- 8< --- 8< 

further testing on other platforms show the patterns below,
so it looks like being a problem on some 64 bit platforms, but not 
on x86_64 (running SUSE 9.0).  
we're using gcc-3.3.3 or gcc-3.3.4 for building on those platforms.

 

separator is $1:

BASH_VERSINFO=([0]="3" [1]="1" [2]="5" [3]="3" [4]="release" 
[5]="hppa2.0w-hp-hpux11.11")
xxyxz
BASH_VERSINFO=([0]="3" [1]="1" [2]="14" [3]="4" [4]="release" 
[5]="powerpc-apple-darwin8.0")
xxyxz
BASH_VERSINFO=([0]="3" [1]="1" [2]="5" [3]="4" [4]="release" 
[5]="powerpc-ibm-aix4.3.3.0")
xxyxz
BASH_VERSINFO=([0]="3" [1]="1" [2]="5" [3]="3" [4]="release" 
[5]="ia64-hp-hpux11.22")
xxyxz


separator is $2:

BASH_VERSINFO=([0]="3" [1]="1" [2]="5" [3]="3" [4]="release" 
[5]="alphaev56-dec-osf4.0e")
xyyyz


ok:

BASH_VERSINFO=([0]="3" [1]="1" [2]="5" [3]="3" [4]="release" 
[5]="hppa2.0w-hp-hpux11.00")
x y z
BASH_VERSINFO=([0]="3" [1]="1" [2]="5" [3]="2" [4]="release" 
[5]="hppa2.0-hp-hpux10.20")
x y z
BASH_VERSINFO=([0]="3" [1]="1" [2]="5" [3]="2" [4]="release" 
[5]="i686-pc-linux-gnu")
x y z
BASH_VERSINFO=([0]="3" [1]="1" [2]="5" [3]="2" [4]="release" 
[5]="sparc-sun-solaris2.5.1")
x y z
BASH_VERSINFO=([0]="3" [1]="1" [2]="5" [3]="2" [4]="release" 
[5]="x86_64-unknown-linux-gnu")
x y z
BASH_VERSINFO=([0]="3" [1]="1" [2]="5" [3]="3" [4]="release" 
[5]="sparc-sun-solaris2.8")
x y z
BASH_VERSINFO=([0]="3" [1]="1" [2]="5" [3]="2" [4]="release" 
[5]="powerpc-ibm-aix5.1.0.0")
x y z
BASH_VERSINFO=([0]="3" [1]="1" [2]="5" [3]="3" [4]="release" 
[5]="mips-sgi-irix6.5")
x y z




Harald Koenig
-- 
"I hope to die  ___   _
before I *have* to use Microsoft Word.",   0--,|/OOO\
Donald E. Knuth, 02-Oct-2001 in Tuebingen.<_/  /  /OOO\
\  \/OOO\
  \ O|//
Harald Koenig  \/\/\/\/\/\/\/\/\/
science+computing ag//  / \\  \
[EMAIL PROTECTED]^   ^


___
Bug-bash mailing list
Bug-bash@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-bash