${(v)…}
: Show array values
v
used with k
show both key and value of an associative array: ${kv}array
.
Links
Examples
- Show key and values of an associative array
- Output:
1 2
declare -A data=([4]=joe [3]=william [2]=jack [1]=averell) echo "Dalton brothers: ${(kvo)data}"
1
Dalton brothers: 3 william 4 joe 1 averell 2 jack
BashSupport Pro is a Zsh IDE with support for ${(v)…} – try it now!