title: "Invalid arithmetic operator" error when checking hostname in Bash script
body: <p>I have a simple hostname check in a bash script:</p>
  
  <pre><code>if [[ `hostname` -eq "cps1214" ]]
  then
      JAVA_HOME=/usr/local/jdk1.6.0_21
  fi
  </code></pre>
  
  <p>On our old SuSE 8 system this works fine. On our newer CentOS system this causes an error:</p>
  
  <pre>[[: dev.example.com: syntax error: invalid arithmetic operator
  (error token is ".example.com")</pre>
  
  <p>I'm not really sure what the issue is here. My understanding is that <code>-eq</code> is explicitly for string comparisons, <code>hostname</code> is clearly returning a string, and the right-hand side is also a string. Why is it complaining about arithmetic?</p>