bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Harald Koenig
Subject: $* and $@ broken on some (64 bit?) platforms in bash 3.1
Date: Thu, 23 Mar 2006 18:28:02 +0100
User-agent: Mutt/1.5.10i

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--,|    /OOOOOOO\
Donald E. Knuth, 02-Oct-2001 in Tuebingen.        <_/  /  /OOOOOOOOOOO\
                                                    \  \/OOOOOOOOOOOOOOO\
                                                      \ OOOOOOOOOOOOOOOOO|//
Harald Koenig                                          \/\/\/\/\/\/\/\/\/
science+computing ag                                    //  /     \\  \
koenig@science-computing.de                            ^^^^^       ^^^^^




reply via email to

[Prev in Thread] Current Thread [Next in Thread]