title: 'For' loop and sleep in a Bash script
body: <p>I have a Bash script with a <code>for</code> loop, and I want to sleep for X seconds.</p>
  
  <pre><code>#!/bin/sh
  for i in `seq 8`;
      do ssh w$i 'uptime;
      ps -elf|grep httpd|wc -l;
      free -m;
      mpstat';
  done &amp;
  pid=$!
  kill -9 $pid
  </code></pre>
  
  <p>In Bash: <code>sleep 2</code> sleeps for two seconds. How can I kill the pid automatically after two seconds?</p>