title: How to capture the output of curl to variable in bash
body: <p>So, lets say I have the following command:</p>
  
  <pre><code>curl -I http://google.com | head -n 1| cut -d $' ' -f2
  </code></pre>
  
  <p>This will capture the http status code??
  Now I want to assign this to variable.. in bash script</p>
  
  <pre><code>like output = "curl -I http://localhost:8088/tracks?key=9 | head -n 1| cut -d $' ' -f2" 
  </code></pre>
  
  <p>or something like that..</p>
  
  <p>How do I assign the response of above command to a variable called output in bash?
  Thanks</p>