title: Can parameter expansion be nested in Bash?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/917260/can-var-expressions-be-nested-in-bash">Can ${var} parameter expansion expressions be nested in bash?</a>  </p>
  </blockquote>
  
  
  
  <p>Is it possible to nest the shell parameter expansion <code>(${})</code>?</p>
  
  <p>If I want to do something like this:</p>
  
  <pre><code>foo=( 1 2 3 4 5 )
  echo ${${foo[@]/3/bar}:1}
  </code></pre>