title: How to evaluate a boolean variable in an if block in bash?
body: <p>I have defined the following variable:</p>
  
  <pre><code>myVar=true
  </code></pre>
  
  <p>now I'd like to run something along the lines of this:</p>
  
  <pre><code>if [ myVar ]
  then
      echo "true"
  else
      echo "false"
  fi
  </code></pre>
  
  <p>The above code does work, but if I try to set </p>
  
  <pre><code>myVar=false
  </code></pre>
  
  <p>it will still output true.
  What might be the problem?</p>
  
  <p>edit: I know I can do something of the form</p>
  
  <pre><code>if [ "$myVar" = "true" ]; then ...
  </code></pre>
  
  <p>but it is kinda awkward.</p>
  
  <p>Thanks</p>