title: if statement to check $HOSTNAME in shell script
body: <p>So I want to set some paths differently depending on the host, but unfortunately it's not working. Here is my script:</p>
  
  <pre><code>if [$HOSTNAME == "foo"]; then
      echo "success"
  else
      echo "failure"
  fi
  </code></pre>
  
  <p>This is what happens:</p>
  
  <pre><code>-bash: [foo: command not found
  failure
  </code></pre>
  
  <p>I know for certain that $HOSTNAME is foo, so I'm not sure what the problem is. I am pretty new to bash though. Any help would be appreciated! Thanks!</p>