title: How to use curl to get web server type?
body: <p>Here's some of the lines from my shell script:</p>
  
  <pre><code>curl -I --connect-timeout 60 google.com|grep "Server:" &gt;&gt; 1000-server.txt
  curl -I --connect-timeout 60 yahoo.com|grep "Server:" &gt;&gt; 1000-server.txt
  curl -I --connect-timeout 60 bing.com|grep "Server:" &gt;&gt; 1000-server.txt
  </code></pre>
  
  <p>My script is getting the web server type correctly in most cases:</p>
  
  <pre><code>Server: gws
  Server: ATS
  Server: Microsoft-IIS/8.5
  </code></pre>
  
  <p>However, if the <code>curl</code> connection times out or get an error, it doesn't output any message.  Also, if for some reason <code>grep</code> doesn't find anything, it doesn't output any error message.</p>
  
  <p>If <code>curl</code> or <code>grep</code> fails, is there any way to output an error message that just says something like <code>"ERROR: NOT FOUND"</code>?</p>
  
  <p>Sorry if this is a newbie questions, just can't figure it out...</p>