1
0
Fork
You've already forked repeat
0
A command line tool for executing a command repeatedly.
  • C 85.7%
  • Roff 13.3%
  • Makefile 1%
Find a file
2016年07月01日 13:07:44 -04:00
AUTHORS Initial commit of repeat 2013年07月29日 10:58:09 -04:00
bootstrap Initial commit of repeat 2013年07月29日 10:58:09 -04:00
configure.in Initial commit of repeat 2013年07月29日 10:58:09 -04:00
Makefile.am Initial commit of repeat 2013年07月29日 10:58:09 -04:00
NEWS Initial commit of repeat 2013年07月29日 10:58:09 -04:00
README.md Update README to show new options 2016年07月01日 13:07:44 -04:00
repeat.1 Rename some options to untilerr and untilsuccess 2016年01月21日 08:48:29 -05:00
repeat.c Add -s to allowed options 2016年07月01日 13:07:35 -04:00

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

  • --interval duration - Specifies an interval between invocations. Defaults to 0.
  • --times num - 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 World Prints out Hello World forever
  • repeat -n 5 echo Hello World Prints out Hello World five times
  • repeat -i 1 echo Hello World Prints out Hello World with a second between each invocation
  • repeat -i 1 -e -p -t 5 echo Hello World Prints out Hello World five times, once a second, stopping if echo returns an error.
  • repeat -i 5 -s grep foobar myfile Checks every seconds for foobar in myfile until it succeeds.