On 17 March 2018 at 11:50, L A Walsh <b...@tlinx.org> wrote:
>
> I'm a bit confused ...
> If I have assoc-array:
>
>  declare -A foo=([one]=11 [two]=22)
>
> and am passing name in another var, like "fee"
>
>  fee=foo
>
> I tried echoing the val:
>
>  echo ${!fee[one]}
>
> but got nothing -- tried a few other syntaxes.

I think this does what you want ...

$ declare -A foo=([one]=11 [two]=22)
$ fee=foo[one]
$ echo "${!fee}"
11

Reply via email to