title: curl: how to return 0 if status is 200?
body: <p>How can I return 0 when the response status is 200?</p>
  <p>Right now I'm able to get the status, e.g. 200 with the following command:</p>
  <pre><code>curl -LI http://google.com -o /dev/null -w '%{http_code}\n' -s
  </code></pre>
  <p>But what I need to do is turn this 200 in a return 0.</p>
  <p>How can I achieve this?</p>
  <p>I tried the following command but it doesn't return:</p>
  <pre><code>if [$(curl -LI http://google.com -o /dev/null -w '%{http_code}\n' -s) == &quot;200&quot;]; then echo 0
  </code></pre>