Facebooktwittergoogle_plusredditpinterestlinkedinmail

You can run a shell script in infinite loop by using while loop.

#!/bin/bash
while true
do
	echo "Press CTRL+C to stop the script execution"
	# Enter your desired command in this block.
done

You can also do this using below inline command

while true; do echo 'Press CTRL+C to stop the script execution'; done

You can also run an infinite loop in the background

while /bin/true; do
    something_in_the_background
done &

Reference:
https://unix.stackexchange.com/questions/223778/how-to-run-an-infinite-loop-in-the-background

How to Run a Shell Script in Infinite Loop Roopendra Scripting,,
You can run a shell script in infinite loop by using while loop. #!/bin/bash while true do echo 'Press CTRL+C to stop the script execution' # Enter your desired command in this block. done You can also do this using below inline command while true; do echo 'Press CTRL+C to stop the script execution'; done You can also run...
You can run a shell script in infinite loop by using <strong>while </strong>loop. <pre>#!/bin/bash while true do echo "Press CTRL+C to stop the script execution" # Enter your desired command in this block. done</pre> You can also do this using below inline command <pre>while true; do echo 'Press CTRL+C to stop the script execution'; done</pre> You can also run an infinite loop in the background <pre>while /bin/true; do something_in_the_background done & </pre> Reference: https://unix.stackexchange.com/questions/223778/how-to-run-an-infinite-loop-in-the-background
(Visited 13 times, 13 visits today)
Facebooktwittergoogle_pluslinkedinrss