-
-
Save wayneeseguin/604965 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| #!/usr/bin/env bash | |
| cloop () { | |
| # First parameter is $1, second is $2, etc... | |
| # If you want to capture all arguments use "$@" | |
| # Here we declare a local variable promoting clarity | |
| local command="$@" | |
| # ':' denotes true in shell scripting. | |
| while : ; do | |
| # Quoting can be very important, use liberally. | |
| $command | |
| # Naptime, yay! | |
| sleep 5 | |
| done | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment