title: Why does this if statement give me an error
body: <p>Can someone explain why this simple bash script:</p>
  
  <pre><code>#!/bin/bash
  
  myvar="Hello"
  
  if [[ -z "$myvar" ]]; then
      # echo "It's an unfilled string"
  else
      echo "It's a filled string!"
  fi
  </code></pre>
  
  <p>gives me the error </p>
  
  <pre><code>./testscript: line 7: syntax error near unexpected token `else'
  ./testscript: line 7: `else'
  </code></pre>
  
  <p>However, if I remove the comment on the echo line, the script runs fine. Obviously, there is an issue with having commented lines within empty if statements. This this in mind, how do I fix it so I can have an empty if statement with comments? </p>