Skip to content

How to execute a command repeatedly using bash

How to execute a command repeatedly using bash

Answer:

The following simple bash script will run the echo command, sleep 10 seconds repeatedly.

#!/bin/bash 

while [1];
do
    echo "Hello!";
    sleep 10;
done
Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Blogplay
  1. How to measure the time needed to execute a command
  2. How to perform syntax check on a bash script?
  3. How to get the PID in current bash shell script
  4. Convert IP address to HEX in Bash script
  5. How to mass rename file in Bash

Post a Comment

Your email is never published nor shared. Required fields are marked *
*
*