Skip to content

Instantly share code, notes, and snippets.

@andyvanee
Created March 2, 2015 17:42
Show Gist options
  • Save andyvanee/4b9b4f757544350da437 to your computer and use it in GitHub Desktop.
Save andyvanee/4b9b4f757544350da437 to your computer and use it in GitHub Desktop.
Bash every command
# 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