Site icon Bytefreaks.net

One line infinite while loop

Advertisements

while true; do echo 'Hit CTRL+C to exit'; someCommand; someOtherCommand; sleep 1; done

alternative syntax

while :; do echo 'Hit CTRL+C to exit'; someCommand; someOtherCommand; sleep 1; done

This post is also available in: Greek

Exit mobile version