title: Array of arrays in bash
body: <p>I'm attempting to read an input file line by line which contains fields delimited by periods.
  I want to put them into an array of arrays so I can loop through them later on.  The input appears to be ok, but 'pushing' that onto the array (inData) doesn't appear to be working.</p>
  
  <p>The code goes :</p>
  
  <pre><code>Input file: 
  GSDB.GOSALESDW_DIST_INVENTORY_FACT.MONTH_KEY
  GSDB.GOSALESDW_DIST_INVENTORY_FACT.ORGANIZATION_KEY
  
  
  infile=${1}
  
  OIFS=$IFS
  IFS=":"
  
  cat ${infile} | while read line
  do
        line=${line//\./:}
        inarray=(${line})
  #      echo ${inarray[@]}
  #      echo ${#inarray[@]}      
  #      echo ${inarray[0]}
  #      echo ${inarray[1]}
  #      echo ${inarray[2]}
  
        inData=("${inData[@]}" "${inarray[@]}")
  done 
  IFS=$OIFS
  
  echo ${#inData[@]}   
  
  for ((i = 0; i &lt; ${#inData[@]}; i++))
  do
   echo $i
      for ((j = 0; j &lt; ${#inData[$i][@]}; j++))
      do
         echo ${inData[$i][$j]}
      done
  done
  </code></pre>