title: Difference between ${} and $() in Bash
body: <p>I have two questions and could use some help understanding them.</p>
  
  <ol>
  <li><p>What is the difference between <code>${}</code> and <code>$()</code>? I understand that <code>()</code>
  means running command in separate shell and placing <code>$</code> means passing
  the value to variable. Can someone help me in understanding
  this? Please correct me if I am wrong.</p></li>
  <li><p>If we can use <code>for ((i=0;i&lt;10;i++)); do echo $i; done</code> and it works fine then why can't I use it as <code>while ((i=0;i&lt;10;i++)); do echo $i; done</code>? What is the difference in execution cycle for both?</p></li>
  </ol>