title: When do you need a dollar symbol before an arithmetic statement in bash?
body: <p>I am trying to get my head around bash but am struggling with some core foundations.</p>
  
  <p>I can see an arithmetic statement is defined by double parentheses </p>
  
  <pre><code>((5-3))
  </code></pre>
  
  <p>but if I try to <code>echo</code> that or us it in <code>shift</code> I get an error</p>
  
  <pre><code>echo ((5-3))
  -bash: syntax error near unexpected token `('
  </code></pre>
  
  <p>In examples it shows that prefixing it with a dollar symbol will make it work</p>
  
  <pre><code>echo $((5-3))
  </code></pre>
  
  <p>Why is that? The syntax looks as though I'm applying the arithmetic to a blank variable and then onto the <code>echo</code> function. Why can't I just pass the result of the arithmetic into the <code>echo</code> function? How do I know when to prefix an arithmetic statement with a dollar symbol in other instances.</p>
  
  <p>Please excuse my ignorance. Im so used to web development languages and Bash is just so different.</p>