cmdseqallows users to execute interleaved sequences of commands. Assuming the same counts and commands, on each execution cmdseq executes one of the commands, cycling through the sequence and wrapping back to the beginning when it is complete. For example, consider the following sequence:
$ cmdseq 2 "echo cmd1" 1 "echo cmd2" cmd1 $ cmdseq 2 "echo cmd1" 1 "echo cmd2" cmd1 $ cmdseq 2 "echo cmd1" 1 "echo cmd2" cmd2 $ cmdseq 2 "echo cmd1" 1 "echo cmd2" cmd1
cmdseqcan be useful for integrating with tools such as
cron. For example, if one is automatically synchronising large directories, one can set up a cron job which usually performs a quick synchronisation, occasionally performing a slow synchronisation:
$ crontab -l */9 * * * * cmdseq 200 "sync quick" 1 "sync full"
cmdseqworks by storing a cookie file of its current position in any given command sequence. This cookie file is unique to each command sequence, and thus multiple command sequences can be safely used.
- cmdseq 0.1 (2016-01-01) (2KiB)
- First public release.
You can also view cmdseq's git history. Patches are always gratefully received.
UsageThe command-line arguments are as follows:
cmdseq [-d <count dir>] <count1> <cmd1> [... <countn> <cmdn>]Where:
||is a directory used to store command sequence
cookies. It defaults to |
||is an integer number of times
||is a command to be executed. If the command has options, it should be surrounded by quote marks.|
cmdseqexits with the exit code of whichever