title: Maintain insertion order for a bash associative array
body: <p>I'm scripting in Bash.</p>
  
  <p>I have an issue with my associative array, when I put a record in my array like that: </p>
  
  <pre><code>declare -A arr_list_people_name
  </code></pre>
  
  <p>The way I put text in my associative array in a loop (put text sorted) :</p>
  
  <pre><code>arr_list_people_name[$peopleId]+=$peopleName
  </code></pre>
  
  <p>The way I read my array:</p>
  
  <pre><code>for KEY in "${!arr_list_people_name[@]}"; do
    # Print the KEY value
    echo "Key: $KEY"
    # Print the VALUE attached to that KEY
    echo "Value: ${arr_list_people_name[$KEY]}"
  done
  </code></pre>
  
  <p>My list is not in the same order compare to the way I recorded it. However, I d like to find the same order than the way I recorded it in my array (sorted by value or key).</p>
  
  <p>Do you have any idea how to manage that ?</p>