Re: feature request array expansion of keys values pairs and for k v loop

2021-08-18 Thread Koichi Murase
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

feature request array expansion of keys values pairs and for k v loop

2021-08-18 Thread Léa Gris
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)