bug-bash
[Top][All Lists]
Advanced

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

Array name expansion in bash-4.3


From: Corentin Peuvrel
Subject: Array name expansion in bash-4.3
Date: Tue, 22 Jul 2014 19:24:45 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Icedove/24.6.0

Hello,

I think I found a bug in bash-4.3.

An example should be self-explanatory :

bash-4.2 :
$ arr=( idx1 idx2 )
$ i=arr[1]
$ echo ${!i}
idx2
$ echo ${!i/x/X}
idX2

bash-4.3 :
$ arr=( idx1 idx2 )
$ i=arr[1]
$ echo ${!i}
idx2
$ echo ${!i/x/X}
idX1

If we use pattern substitution (or removing prefix/suffix pattern, ...) with an expansion of an array name which contain a non zero index, it will still use the index 0.

Thank you,

Corentin Peuvrel



reply via email to

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