${(v)…}: Show array values

v used with k show both key and value of an associative array: ${kv}array.

Examples

Show key and values of an associative array
1
2
declare -A data=([4]=joe [3]=william [2]=jack [1]=averell)
echo "Dalton brothers: ${(kvo)data}"
Output:
1
Dalton brothers: 3 william 4 joe 1 averell 2 jack
BashSupport Pro ist eine Zsh IDE mit Unterstützung für ${(v)…} - probieren Sie es jetzt aus!
© 2020–2024 Joachim Ansorg
Impressum
Datenschutz
Rechtliches