xref: /freebsd/usr.bin/seq/seq.1 (revision f05cddf9)
1.\"	$NetBSD: seq.1,v 1.6 2008/11/26 15:03:47 ginsbach Exp $
2.\"
3.\" Copyright (c) 2005 The NetBSD Foundation, Inc.
4.\" All rights reserved.
5.\"
6.\" This code is derived from software contributed to The NetBSD Foundation
7.\" by Brian Ginsbach.
8.\"
9.\" Redistribution and use in source and binary forms, with or without
10.\" modification, are permitted provided that the following conditions
11.\" are met:
12.\" 1. Redistributions of source code must retain the above copyright
13.\"    notice, this list of conditions and the following disclaimer.
14.\" 2. Redistributions in binary form must reproduce the above copyright
15.\"    notice, this list of conditions and the following disclaimer in the
16.\"    documentation and/or other materials provided with the distribution.
17.\"
18.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
19.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
20.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
21.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
22.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28.\" POSSIBILITY OF SUCH DAMAGE.
29.\"
30.\" $FreeBSD$
31.\"
32.Dd February 19, 2010
33.Dt SEQ 1
34.Os
35.Sh NAME
36.Nm seq
37.Nd print sequences of numbers
38.Sh SYNOPSIS
39.Nm
40.Op Fl w
41.Op Fl f Ar format
42.Op Fl s Ar string
43.Op Fl t Ar string
44.Op Ar first Op Ar incr
45.Ar last
46.Sh DESCRIPTION
47The
48.Nm
49utility prints a sequence of numbers, one per line
50.Pq default ,
51from
52.Ar first
53.Pq default 1 ,
54to near
55.Ar last
56as possible, in increments of
57.Ar incr
58.Pq default 1 .
59When
60.Ar first
61is larger than
62.Ar last
63the default
64.Ar incr
65is -1.
66.Pp
67All numbers are interpreted as floating point.
68.Pp
69Normally integer values are printed as decimal integers.
70.Pp
71The
72.Nm
73utility accepts the following options:
74.Bl -tag -width Ar
75.It Fl f Ar format
76Use a
77.Xr printf 3
78style
79.Ar format
80to print each number.
81Only the
82.Cm E ,
83.Cm e ,
84.Cm f ,
85.Cm G ,
86.Cm g ,
87and
88.Cm %
89conversion characters are valid, along with any optional
90flags and an optional numeric minimum field width or precision.
91The
92.Ar format
93can contain character escape sequences in backslash notation as
94defined in
95.St -ansiC .
96The default is
97.Cm %g .
98.It Fl s Ar string
99Use
100.Ar string
101to separate numbers.
102The
103.Ar string
104can contain character escape sequences in backslash notation as
105defined in
106.St -ansiC .
107The default is
108.Cm \en .
109.It Fl t Ar string
110Use
111.Ar string
112to terminate sequence of numbers.
113The
114.Ar string
115can contain character escape sequences in backslash notation as
116defined in
117.St -ansiC .
118This option is useful when the default separator
119does not contain a
120.Cm \en .
121.It Fl w
122Equalize the widths of all numbers by padding with zeros as necessary.
123This option has no effect with the
124.Fl f
125option.
126If any sequence numbers will be printed in exponential notation,
127the default conversion is changed to
128.Cm %e .
129.El
130.Sh EXIT STATUS
131.Ex -std
132.Sh EXAMPLES
133.Bd -literal -offset indent
134# seq 1 3
1351
1362
1373
138
139# seq 3 1
1403
1412
1421
143
144# seq -w 0 .05 .1
1450.00
1460.05
1470.10
148.Ed
149.Sh SEE ALSO
150.Xr jot 1 ,
151.Xr printf 1 ,
152.Xr printf 3
153.Sh HISTORY
154The
155.Nm
156command first appeared in
157.Tn "Plan 9 from Bell Labs" .
158A
159.Nm
160command appeared in
161.Nx 3.0 ,
162and ported to
163.Fx 9.0 .
164This command was based on the command of the same name in
165.Tn "Plan 9 from Bell Labs"
166and the
167.Tn GNU
168core utilities.
169The
170.Tn GNU
171.Nm
172command first appeared in the 1.13 shell utilities release.
173.Sh BUGS
174The
175.Fl w
176option does not handle the transition from pure floating point
177to exponent representation very well.
178The
179.Nm
180command is not bug for bug compatible with the
181.Tn "Plan 9 from Bell Labs"
182or
183.Tn GNU
184versions of
185.Nm .
186