blob: 3f295c0414762b8b004518353a313f46e09ef375 [file] [log] [blame]
rsccfa37a72004-04-10 18:53:55 +00001.TH SEQ 1
2.SH NAME
3seq \- print sequences of numbers
4.SH SYNOPSIS
5.B seq
6[
7.B -w
8]
9[
10.BI -f format
11]
12[
13.I first
14[
15.I incr
16]
17]
18.I last
19.SH DESCRIPTION
20.I Seq
21prints a sequence of numbers, one per line, from
22.I first
23(default 1) to as near
24.I last
25as possible, in increments of
26.I incr
27(default 1).
28The loop is:
29.sp
30.EX
31 for(val = min; val <= max; val += incr) print val;
32.EE
33.sp
34The numbers are interpreted as floating point.
35.PP
36Normally integer values are printed as decimal integers.
37The options are
38.TP "\w'\fL-f \fIformat\fLXX'u"
39.BI -f format
40Use the
rsc058b0112005-01-03 06:40:20 +000041.IR print (3)-style
rsccfa37a72004-04-10 18:53:55 +000042.I format
43.IR print
44for printing each (floating point) number.
45The default is
46.LR %g .
47.TP
48.B -w
49Equalize the widths of all numbers by padding with
50leading zeros as necessary.
51Not effective with option
52.BR -f ,
53nor with numbers in exponential notation.
54.SH EXAMPLES
55.TP
56.L
57seq 0 .05 .1
58Print
59.BR "0 0.05 0.1"
60(on separate lines).
61.TP
62.L
63seq -w 0 .05 .1
64Print
65.BR "0.00 0.05 0.10" .
66.SH SOURCE
rscc3674de2005-01-11 17:37:33 +000067.B \*9/src/cmd/seq.c
rsccfa37a72004-04-10 18:53:55 +000068.SH BUGS
69Option
70.B -w
71always surveys every value in advance.
72Thus
73.L
74seq -w 1000000000
75is a painful way to get an `infinite' sequence.