title: Curl inside "if" condition in shell script
body: <p>I referred to multiple articles to solve my problem but no luck. I'm trying curl inside <code>if</code>; as the value comparison is an arithmetic operation, I'm using the <code>&gt;</code> operator with <code>((</code>. </p>
  
  <p>However, the command is failing with error</p>
  
  <blockquote>
    <p>bash: ((: > 0: syntax error: operand expected (error token is "> 0")</p>
  </blockquote>
  
  <p>Here is my command:</p>
  
  <pre><code>if (( $(curl --max-time 10 $serviceName) &gt; 0)); then echo ERROR ; fi
  </code></pre>
  
  <p>What is wrong in the command?</p>