bug-bash
[Top][All Lists]
Advanced

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

bash expr problem/bug... 0$val


From: bloodman
Subject: bash expr problem/bug... 0$val
Date: Fri, 19 Aug 2005 14:16:01 +0200

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 trzcianka.eu.org 2.4.31-grpom #1 ¶ro cze 15 00:42:24 CEST 
2005 i686 GNU/Linux
Machine Type: i386-pc-linux-gnu

Bash Version: 2.05b
Patch Level: 0
Release Status: release

Description:
            bash-expr problems...
            if a=500 i expect "c: 500", but produce 320
            if a="z" i expect "c: 0", but produce 40
            etc.
            (for example in zsh wvwerything works fine...:( )
            What's wrong? Why 0 (zero) make a problems? Bug?

Repeat-By:
            <bash>#  a=500; b="0$[a]"; c=$[b]; echo -e "a: $a\nb: $b\nc: $c\n"
            a: 500
            b: 0500
            c: 320

            <bash>#  a=50; b="0$[a]"; c=$[b]; echo -e "a: $a\nb: $b\nc: $c\n"
            a: 50
            b: 050
            c: 40

            <bash>#  a="z"; b="0$[a]"; c=$[b]; echo -e "a: $a\nb: $b\nc: $c\n"
            a: z
            b: 00
            c: 0

            <bash>#  last example produces correct (for me) behaviour... ;)


-- 
eof




reply via email to

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