I've got a bash script where I need to loop through an array and separately echo the key/value in an array. Seems simple enough but regardless of my combination, I can only get the key to show the numerical key, e.g. 0.
declare -a PROJECT=([Client1]=ProjectClient1 [Client2]=ProjectClient2)
for i in "${!PROJECT[@]}"; do
echo "1: $i"
echo "2: ${PROJECT[i]}"
echo "3: ${PROJECT[$i]}"
None of these result in "Client1". I'm sure it is obvious but what am I missing?