title: What is the benefit of using $() instead of backticks in shell scripts?
body: <p>There are two ways to capture the output of command line in <code>bash</code>:</p>
  
  <ol>
  <li><p>Legacy Bourne shell backticks <code>``</code>:</p>
  
  <pre><code>var=`command`
  </code></pre></li>
  <li><p><code>$()</code> syntax (which as far as I know is Bash specific, or at least not supported by non-POSIX old shells like original Bourne)</p>
  
  <pre><code>var=$(command)
  </code></pre></li>
  </ol>
  
  <p>Is there any benefit to using the second syntax compared to backticks? Or are the two fully 100% equivalent?</p>