In Bash (v4 +):
$ declare -A x=([foo]=bar [coconut]=banana) $ echo ${x[@]}
gives:
banana bar
What can I type to get this:
foo coconut
You can run xin echo ${x[@]}with !to get the keys:
x
echo ${x[@]}
!
echo ${!x[@]}
Additional information on associative arrays: http://www.artificialworlds.net/blog/2012/10/17/bash-associative-array-examples/