title: how to use ping in a script
body: <p>I want a bash script that'll do:</p>
  
  <pre><code>for c in computers:
  do
     ping $c
     if ping is sucessfull:
        ssh $c 'check something'
  done
  </code></pre>
  
  <p>If I only do <code>ssh</code> and the computer is iresponsive, it takes forever for the timeout. So I was thinking of using the output of <code>ping</code> to see if the computer is alive or not. How do I do that? Other ideas will be great also </p>