title: Curl "write out" value of specific header
body: <p>I am currently writing a bash script and I'm using curl. What I want to do is get one specific header of a response.</p>
  
  <p>Basically I want this command to work:</p>
  
  <pre><code>curl -I -w "%{etag}" "server/some/resource"
  </code></pre>
  
  <p>Unfortunately it seems as if the -w, --write-out option only has a set of variables it supports and can not print any header that is part of the response. Do I need to parse the curl output myself to get the ETag value or is there a way to make curl print the value of a specific header?</p>
  
  <p>Obviously something like</p>
  
  <pre><code>curl -sSI "server/some/resource" | grep 'ETag:' | sed -r 's/.*"(.*)".*/\1/'
  </code></pre>
  
  <p>does the trick, but it would be nicer to have curl filter the header. </p>