2021年8月19日(木) 9:31 Léa Gris :
> [...]
>
> I'd like some syntax to expand both keys and values into a single
> scalar. Something like a at sign or another symbol meaning both are
> expanded:
>
> # Expand key values pairs as distinct arguments
> printf '%s ' "${@array[@]}"
> printf \\n
FYI, zsh prov
Many time I see use case for expanding both keys and values of an array,
and every time it requires a loop.
Typical use case is with the dialog command. But there are other use
cases where having both key and value expanded would save a loop.
Example:
array=([1]=apple [3]=banana [2]=orange)