bug-bash
[Top][All Lists]
Advanced

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

Re: List of keys of an associative array


From: Pierre Gaston
Subject: Re: List of keys of an associative array
Date: Fri, 31 Dec 2010 11:52:12 +0200

On Fri, Dec 31, 2010 at 11:38 AM, <dnade.ext@orange-ftgroup.com> wrote:

>        Hello
>
> For regular arrays, we can get the list of keys by using the form
> ${!some_array[@]}.
> But this just doesn’t work for associative arrays.
>
> ${!some_associative_array[@]} is actually 0. Is that a bug ?
> Is there another way to get the list of keys available in an associative
> array ?
>


$ declare -A a;a[foo]=bar;a[baz]=bux;echo ${!a[@]}
baz foo


reply via email to

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