OsGate.org Logo

Previous Previous | Next Next

Execute a loop in a terminal - loop while for terminal

Script and coding Script and coding

Date 12.02.2012

Visits 3379



If you want to execute a loop directly from the terminal:

  • infinite while loop:
    • bash-4.1# while [ 1 ]; do uptime; sleep 5; done
  • for loop:
    • for i in $(seq 50); do echo "it works"; sleep 5; done