> > array_to_key() { > > # Converts 1 2 3 -> 1,2,3, (comma at the end) > > printf '%d,' "$@" > > } > > > > multi_store() { > > local array_name="$1"; shift > > local value="$1"; shift > > if unset -v "$array_name"; then > > declare -A $array_name > > declare -- $array_name[$(array_to_key "$@")]="$value" > > fi > > } > > > > multi_store CHESS_3D queen 2 2 5 > > Bash version? This was fixed before bash-4.3 was released.
Oh, I thought originally it's latest stable, but on second look that machine was not updated yet. So both Solaris and linux older that 4.3. I'm sorry for the noise -- Vlad