title: How to iterate over an array using indirect reference?
body: <p>How can I make this code work?</p>
  
  <pre><code>#!/bin/bash
  ARRAYNAME='FRUITS'
  FRUITS=( APPLE BANANA ORANGE )
  for FRUIT in ${!ARRAYNAME[@]}
  do
      echo ${FRUIT}
  done
  </code></pre>
  
  <p>This code:  </p>
  
  <pre><code>echo ${!ARRAYNAME[0]}
  </code></pre>
  
  <p>Prints <strong>APPLE</strong>. I'm tryng to do something similar but with "[@]" to iterate over the array.</p>
  
  <p>Thanks in advance,</p>