Chet Ramey <chet.ra...@case.edu> writes: > On 3/20/14 12:41 AM, Richard Tollerton wrote: >> >> I suppose that this change in behavior makes array variables more >> consistent with normal variables, but I couldn't find anything in >> CHANGES which obviously relates to this, so I'm not sure if this is a >> bug or not. > > There is this, in the list of changes in bash-4.3-beta: > > f. Fixed several cases where `invisible' variables (variables with attributes > but no values, which are technically unset) were treated > incorrectly.
D'oh! >> Was I always mistaken in figuring that declaring an array also >> initialized it? > > A variable is not set until it has been assigned a value. This was always > true, and always supposed to apply to array variables as it did to scalars. > bash-4.2 had a number of inconsistencies here, and I fixed some number of > those. I'm sure some still remain. > > This topic has come up several times in the past, most recently a couple > of weeks ago: > > http://lists.gnu.org/archive/html/bug-bash/2013-01/msg00068.html > http://lists.gnu.org/archive/html/bug-bash/2013-11/msg00000.html > http://lists.gnu.org/archive/html/bug-bash/2014-03/msg00052.html Understood. Looks like I have some more (worthwhile) reading to do. Thanks! > Chet > -- > ``The lyf so short, the craft so long to lerne.'' - Chaucer > ``Ars longa, vita brevis'' - Hippocrates > Chet Ramey, ITS, CWRU c...@case.edu http://cnswww.cns.cwru.edu/~chet/ -- Richard Tollerton <rich.toller...@ni.com>