title: How to execute the same loop for 1 hour in bash/ linux scripting?
body: <p>I want to open and close some web pages with random intervals for an hour.</p>
  
  <p>So far i have written the innards</p>
  
  <pre><code>FILE=webpages
  TIMES=0
  while test $TIMES -lt 10
  do
      #Picks random line(Website) from FILE
      TEMPWEB=`shuf -n 1 $FILE`
      echo "Opening" $TEMPWEB
      #Opens TEMPWEB
      xdg-open $TEMPWEB
      sleep 10
      #Kills firefox
      ps -e | grep firefox | sed 's/\(.[0-9]*\).*/\1/' | xargs kill
      TIMES=$(($TIMES+1))
  done
  </code></pre>
  
  <p>So I'm am missing the while condition.<br>
  I want something like:</p>
  
  <pre><code>TIMER = 0h 0m 0s
  while( TIMER &lt; 1 h)
     ....
  done
  </code></pre>
  
  <p>Is this possible?</p>
  
  <p>PS. what's the command to random number?</p>