Last active
December 21, 2015 16:38
-
-
Save thonixx/6334658 to your computer and use it in GitHub Desktop.
Run any command in a while loop
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# loop function | |
# run any command in a while loop with 1 second sleep | |
function loop() { | |
if [ -z "$1" ] | |
then | |
return | |
fi | |
cmd="$1" | |
while true | |
do | |
bash -c "$cmd" | |
sleep 1 | |
done | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment