title: bash4 read file into associative array
body: <p>I am able to read file into a regular array with a single statement:</p>
  
  <pre><code>local -a ary
  readarray -t ary &lt; $fileName
  </code></pre>
  
  <p>Not happening is reading a file into assoc. array.</p>
  
  <p>I have control over file creation and so would like to do as simply as possible w/o loops if possible at all.</p>
  
  <p>So file content can be following to be read in as:</p>
  
  <pre><code>keyname=valueInfo
  </code></pre>
  
  <p>But I am willing to replace = with another string if cuts down on code, especially in a single line code as above.</p>
  
  <h3>And ...</h3>
  
  <p>So would it be possible to read such a file into an assoc array using something like an <code>until</code>  or <code>from</code> - i.e. read into an assoc array until it hits a word, or would I have to do this as part of loop?</p>
  
  <p>This will allow me to keep a lot of similar values in same file, but read into separate arrays.</p>
  
  <p>I looked at <code>mapfile</code> as well, but does same as <code>readarray</code>.</p>
  
  <h3>Finally ...</h3>
  
  <p>I am creating an options list - to select from - as below:</p>
  
  <pre><code>local -a arr=("${!1}")
  select option in ${arr[*]}; do
      echo ${option}
      break
  done
  </code></pre>
  
  <p>Works fine - however the list shown is not sorted. I would like to have it sorted if possible at all.</p>
  
  <p>Hope it is ok to put all 3 questions into 1 as the questions are similar - all on arrays.</p>
  
  <p>Thank you.</p>