By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
462,377 Members | 472 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 462,377 IT Pros & Developers. It's quick & easy.

Create Infinite Loop In Bash

P: 15
I want to run a command for ever in the Linux bash. Also I want to put 60 seconds between command execution.
Apr 21 '20 #1
Share this Question
Share on Google+
2 Replies

P: 162
Expand|Select|Wrap|Line Numbers
  1. while :
  2. do
  3.         echo hello
  4.         sleep 60
  5. done
Apr 22 '20 #2

P: 8
You can use bash infinite loops with the while loop like

while true; do echo "test"; sleep 60; done
Apr 23 '20 #3

Post your reply

Sign in to post your reply or Sign up for a free account.