A command line tool for executing a command repeatedly.
- C 85.7%
- Roff 13.3%
- Makefile 1%
| AUTHORS | Initial commit of repeat | |
| bootstrap | Initial commit of repeat | |
| configure.in | Initial commit of repeat | |
| Makefile.am | Initial commit of repeat | |
| NEWS | Initial commit of repeat | |
| README.md | Update README to show new options | |
| repeat.1 | Rename some options to untilerr and untilsuccess | |
| repeat.c | Add -s to allowed options | |
Repeat - a command line utility
This command line program will execute a command repeatedly. It is intended to replace the shell pattern:
while something; do sleep $seconds; done
With options, it is considerably more flexible.
Options
--intervalduration - Specifies an interval between invocations. Defaults to 0.--timesnum - Executes for a maximum number of times, then exit.--untilerr- Stops repeating when the command's exit code is non-zero--untilsuccess- Stops repeating when the command's exit code is zero--precise- Runs command at specified intervals instead of waiting the interval between executions.--noshell- Runs command directly instead of via an intermediate shell--help- Display usage and exit--version- Display version info and exit
Examples
repeat echo Hello WorldPrints out Hello World foreverrepeat -n 5 echo Hello WorldPrints out Hello World five timesrepeat -i 1 echo Hello WorldPrints out Hello World with a second between each invocationrepeat -i 1 -e -p -t 5 echo Hello WorldPrints out Hello World five times, once a second, stopping if echo returns an error.repeat -i 5 -s grep foobar myfileChecks every seconds for foobar in myfile until it succeeds.