seq [-w] [-f format] [-s string] [-t string] [first [incr]] last Outpus a sequence of numbers, one per line (default), from first (default 1), to near last as possible, in increments of incr (default 1). When first is larger than last, the default incr is -1.
Normally integer values are output as decimal integers.
All numbers are interpreted as floating point.
-f format |
# seq 1 3
1
2
3
Generate a sequence from 3 to 1 (included) with a default increment of -1:
# seq 3 1
3
2
1
Generate a sequence from 0 to 0.1 (included) with an increment of 0.05 and padding with leading zeroes.
# seq -w 0 .05 .1
0.00
0.05
0.10
Generate a sequence from 1 to 3 (included) with a default increment of 1, a custom separator string and a custom
terminator:
# seq -s "-->" -t "[end of list]\n" 1 3
1-->2-->3-->[end of list]
Generate a sequence from 1 to 2 (included) with an increment of 0.2 and print the results with two digits after the
decimal point (using a printf(3) style format):
# seq -f %.2f 1 0.2 2
1.00
1.20
1.40
1.60
1.80
2.00