cnt - index counter
cnt [ -s ] N1 [ N2 .. ]
Cnt counts from 0 to N-1, producing N lines of output. If multiple arguments are given, cnt produces a nested array of values where the final counter rotates fastest through its range. The -s option shuffles the output lines, giving a different random order on each invocation. Cnt is most useful in conjunction with rcalc(1) to produce array values.
To create a 3 by 5 array:
cnt 3 5 |
To generate a random shuffle of indices 0 through 51:
cnt -s 52 |
Similar shuffling broken down by suit:
cnt -s 4 13 |
Greg Ward
neaten(1), rcalc(1), rlam(1), rsplit(1), total(1)