CMDSEQ(1) General Commands Manual CMDSEQ(1)

cmdseqExecute interleaved sequences of commands

cmdseq [-d count_dir] count_1 cmd_1 [... count_n cmd_n]

cmdseq executes interleaved sequences of commands. For a given sequence of counts and commands, each execution of cmdseq executes one of the commands, cycling through the sequence and wrapping back to the beginning when it is complete.

The options are as follows:

count_dir
specifies where cmdseq stores its cookie file. Defaults to /tmp/
count cmd
Specifies that the positive non-zero integer iterations of cmd should be executed before moving to the next command in the sequence.

cmdseq exits with the exit code of whichever cmd it ran.

$ 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

cmdseq was written by Laurence Tratt ⟨https://tratt.net/laurie/⟩

December 19, 2021 OpenBSD 7.6