On Fri, Sep 23, 2005, Stuart Shelton wrote: > > If I run 'A=$(( 3 + 4 )); echo $A' on different shells, I get the > following results: > > $ locate bin/bash > /usr/bsd/bin/bash > /usr/gnu/bin/bash > /usr/nekoware/bin/bash > /usr/openpkg/bin/bash > > $ /usr/bsd/bin/bash --version > GNU bash, version 3.00.16(1)-release (mips-sgi-irix6.5) > Copyright (C) 2004 Free Software Foundation, Inc. > $ /usr/gnu/bin/bash --version > GNU bash, version 2.05b.0(1)-release (mips-sgi-irix6.5) > Copyright (C) 2002 Free Software Foundation, Inc. > $ /usr/nekoware/bin/bash --version > GNU bash, version 3.00.0(1)-release (mips-sgi-irix6.5) > Copyright (C) 2004 Free Software Foundation, Inc. > $ /usr/openpkg/bin/bash --version > GNU bash, version 3.00.16(1)-release (mips-sgi-irix6.5) [OpenPKG-CURRENT] > Copyright (C) 2004 Free Software Foundation, Inc. > > $ /usr/bsd/bin/bash -c 'A=$(( 3 + 4 )); echo $A' > /usr/bsd/bin/bash: 3: command not found > ) > $ /usr/gnu/bin/bash -c 'A=$(( 3 + 4 )); echo $A' > 7 > $ /usr/nekoware/bin/bash -c 'A=$(( 3 + 4 )); echo $A' > /usr/nekoware/bin/bash: 3: command not found > ) > $ /usr/openpkg/bin/bash -c 'A=$(( 3 + 4 )); echo $A' > /usr/openpkg/bin/bash: 3: command not found > )
Well, this is what i get under IRIX: /openpkg-dev/lib/openpkg/bash -c 'A=$(( 3 + 4 )); echo $A' 7 I only have installed the bootstrap, so far (patches this evening). But i think the bash in the bootstrap is not different from the one in the separate package, currently. > Having said that, the command "A=$(( echo 3 )); echo $A" results in "3)" > in bash-3 - which surely can't be right?! No. A=$(( xxx )) should be something like A=`expr xxx`, as far as i remember. Take a look in the bash manpage. > The problem is that the rc script in /usr/openpkg/etc/rc uses exactly this > syntax, and so the errors are similar to: > > $ /usr/openpkg/etc/rc all start > OpenPKG: start: /usr/openpkg/etc/rc: line 448: 0: command not found > openpkg/usr/openpkg/etc/rc: line 455: ): command not found > /usr/openpkg/etc/rc: line 665: [: ): integer expression expected bash-3.00$ /openpkg-dev/etc/rc openpkg:rc:ERROR: no package and command(s) specified > (there are a few more be default which I fixed, but didn't keep a backup > of the unchanged file) > > I tried the same tests on my Linux machine, and all worked. > > So is bash-3 broken on my platform (IRIX64)? I've seen no other problems > or incompatibilities - but this does seem fairly serious. Well, if i could bet, i would blame the compiler... Could you give gcc a try ? (mk) -- Matthias Kurz; Fuldastr. 3; D-28199 Bremen; VOICE +49 421 53 600 47 >> Im prämotorischen Cortex kann jeder ein Held sein. (bdw) << ______________________________________________________________________ The OpenPKG Project www.openpkg.org Developer Communication List openpkg-dev@openpkg.org