title: how to get status of CURL command for success and failures in shell script
body: <p>I am facing one issue while executing the CURL command using shell. The issue is i want to get the status of the curl command execution.</p>
  
  <p>my command is :</p>
  
  <pre><code>    location=curl https://invvvv.usvvv.com/agg/tari?uswg-key=8e3eedhhhh4a9a370605637 --output output.zip --proxy proxy-az.azure.ghop.fguiop.com:8080
  </code></pre>
  
  <p>The issue is if it is success then i will be getting one location in the ${location} variable, which is perfectly fine.But if the CURL execution is failure, i am not getting any values in the variable (only empty value).</p>
  
  <p>My question is how can i get the status of curl command execution, i have tried with if [ $? -eq 0 ], but for failure also it is showing $? is 0.</p>
  
  <p>How can i get the status of the curl command ? please help   </p>