Created
March 2, 2015 17:42
-
-
Save andyvanee/4b9b4f757544350da437 to your computer and use it in GitHub Desktop.
Bash every command
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
# Put this in your .profile or source it | |
# Run a command forever | |
# every 10 "echo hello" | |
function every() { | |
timeout=$1 && shift | |
cmd=$@ | |
while true; do eval "$cmd"; sleep $timeout; done | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment