title: Why do some people put a semicolon after an if condition in shell scripts?
body: <p>I'm just getting used to shell scripting, and I've come across something which I'm not really sure how to google.</p>
  
  <p>In the tutorials I was reading, it suggests that the correct way to write an if statement is like this:</p>
  
  <pre><code>if [ $a == $b ]; then
    echo "a == b"
  fi
  </code></pre>
  
  <p>However I've seen in our code base places where the semi colon is omitted:</p>
  
  <pre><code>if [ $a == $b ] then
    echo "a == b"
  fi
  </code></pre>
  
  <p>I've also seen double square brackets:</p>
  
  <pre><code>if [[ $a == $b ]]; then
    echo "a == b"
  fi
  </code></pre>
  
  <p>When I've tested all of these in bash, there doesn't seem to be a difference.  Is there a difference?  Does it have to do with compatibility?  What is the correct style to adopt?</p>