bug-bash
[Top][All Lists]
Advanced

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

"Bad substitution error" is not "well" reported, when invoking and array


From: Andres Sajo
Subject: "Bad substitution error" is not "well" reported, when invoking and array.
Date: Fri, 18 Jan 2008 14:40:48 -0800 (PST)

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 -Wall
uname output: Linux tasse 2.6.22-14-generic #1 SMP Tue Dec 18 08:02:57
UTC 2007 i686 GNU/Linux
Machine Type: i486-pc-linux-gnu

Bash Version: 3.2
Patch Level: 25
Release Status: release

Description:
        "Bad substitution error" is not "well" reported, when invoking
and array:
        VAR='([0]=first [1]=second)'
        ${VAR[0] } works, but ${ VAR[0]} dosen't


Repeat-By:

address@hidden:~$ declare -a NAME[0]="Andres" NAME[1]="Sajo"
address@hidden:~$ declare -p NAME
declare -a NAME='([0]="Andres" [1]="Sajo")'

## Command 1
address@hidden:~$ echo ${ NAME[0]}
bash: ${ NAME[0]}: bad substitution

##Command 2
address@hidden:~$ echo ${NAME[0] }
Andres
##Should have reported the previous error

address@hidden:~$ echo ${NAME[0]}
Andres

## The "bad substitution error" should be OR in both Commands OR in
none of them.

Fix:
        None



      
____________________________________________________________________________________
Never miss a thing.  Make Yahoo your home page. 
http://www.yahoo.com/r/hs




reply via email to

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