title: How does Bash deal with brackets inside of double quoting?
body: <p>The question is basically, how does bash deal with double quotes and brackets?</p>
  
  <p>I couldn't come up with a better example, so apologies about that, but imagine something like this:</p>
  
  <p><code>"$(echo "${foo}")"</code></p>
  
  <p>What happens there? Is <code>${foo}</code> technically out of the quotation scope? Is bash smart enough to also consider that it is inside of the parentheses and work inside-out? Would <code>\"${foo}\"</code> work better?</p>
  
  <p>I've tried Googling this, but no luck. Please note that this is different from just nested quoting questions, as it includes expansion.</p>
  
  <p>Thanks!</p>