title: How do you store a list of directories into an array in Bash (and then print them out)?
body: <p>I want to write a shell script to show a list of directories entered by a user and then for a user to select one of the directories with an index number based on how many directories there are</p>
  
  <p>I'm thinking this is some kind of array operation, but im not sure how to do this in shell script</p>
  
  <p>example:</p>
  
  <pre><code>&gt; whichdir
  There are 3 dirs in the current path
  1 dir1
  2 dir2
  3 dir3
  which dir do you want? 
  &gt; 3
  you selected dir3!
  </code></pre>