I have an associative array:
declare -A hash
hash[one]=1
hash[two]=2
hash[third item]=3
How can I create an indexed array from the keys of this associative array?
To make an array with the keys from an associative array:
arr=("${!hash[@]}")
To make an array with the values:
arr=("${hash[@]}")
Note that you need the double quotes to prevent the shell from word splitting.