xref: /freebsd/usr.bin/seq/seq.1 (revision 208987a53c20a3bba7da56655f34c635d56b41ac)
1208987a5SXin LI.\"	$NetBSD: seq.1,v 1.6 2008/11/26 15:03:47 ginsbach Exp $
2208987a5SXin LI.\"
3208987a5SXin LI.\" Copyright (c) 2005 The NetBSD Foundation, Inc.
4208987a5SXin LI.\" All rights reserved.
5208987a5SXin LI.\"
6208987a5SXin LI.\" This code is derived from software contributed to The NetBSD Foundation
7208987a5SXin LI.\" by Brian Ginsbach.
8208987a5SXin LI.\"
9208987a5SXin LI.\" Redistribution and use in source and binary forms, with or without
10208987a5SXin LI.\" modification, are permitted provided that the following conditions
11208987a5SXin LI.\" are met:
12208987a5SXin LI.\" 1. Redistributions of source code must retain the above copyright
13208987a5SXin LI.\"    notice, this list of conditions and the following disclaimer.
14208987a5SXin LI.\" 2. Redistributions in binary form must reproduce the above copyright
15208987a5SXin LI.\"    notice, this list of conditions and the following disclaimer in the
16208987a5SXin LI.\"    documentation and/or other materials provided with the distribution.
17208987a5SXin LI.\"
18208987a5SXin LI.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
19208987a5SXin LI.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
20208987a5SXin LI.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
21208987a5SXin LI.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
22208987a5SXin LI.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23208987a5SXin LI.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24208987a5SXin LI.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25208987a5SXin LI.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26208987a5SXin LI.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27208987a5SXin LI.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28208987a5SXin LI.\" POSSIBILITY OF SUCH DAMAGE.
29208987a5SXin LI.\"
30208987a5SXin LI.\" $FreeBSD$
31208987a5SXin LI.\"
32208987a5SXin LI.Dd February 19, 2010
33208987a5SXin LI.Dt SEQ 1
34208987a5SXin LI.Os
35208987a5SXin LI.Sh NAME
36208987a5SXin LI.Nm seq
37208987a5SXin LI.Nd print sequences of numbers
38208987a5SXin LI.Sh SYNOPSIS
39208987a5SXin LI.Nm
40208987a5SXin LI.Op Fl w
41208987a5SXin LI.Op Fl f Ar format
42208987a5SXin LI.Op Fl s Ar string
43208987a5SXin LI.Op Fl t Ar string
44208987a5SXin LI.Op Ar first Op Ar incr
45208987a5SXin LI.Ar last
46208987a5SXin LI.Sh DESCRIPTION
47208987a5SXin LIThe
48208987a5SXin LI.Nm
49208987a5SXin LIutility prints a sequence of numbers, one per line
50208987a5SXin LI.Pq default ,
51208987a5SXin LIfrom
52208987a5SXin LI.Ar first
53208987a5SXin LI.Pq default 1 ,
54208987a5SXin LIto near
55208987a5SXin LI.Ar last
56208987a5SXin LIas possible, in increments of
57208987a5SXin LI.Ar incr
58208987a5SXin LI.Pq default 1 .
59208987a5SXin LIWhen
60208987a5SXin LI.Ar first
61208987a5SXin LIis larger than
62208987a5SXin LI.Ar last
63208987a5SXin LIthe default
64208987a5SXin LI.Ar incr
65208987a5SXin LIis -1.
66208987a5SXin LI.Pp
67208987a5SXin LIAll numbers are interpreted as floating point.
68208987a5SXin LI.Pp
69208987a5SXin LINormally integer values are printed as decimal integers.
70208987a5SXin LI.Pp
71208987a5SXin LIThe
72208987a5SXin LI.Nm
73208987a5SXin LIutility accepts the following options:
74208987a5SXin LI.Bl -tag -width Ar
75208987a5SXin LI.It Fl f Ar format
76208987a5SXin LIUse a
77208987a5SXin LI.Xr printf 3
78208987a5SXin LIstyle
79208987a5SXin LI.Ar format
80208987a5SXin LIto print each number.
81208987a5SXin LIOnly the
82208987a5SXin LI.Cm E ,
83208987a5SXin LI.Cm e ,
84208987a5SXin LI.Cm f ,
85208987a5SXin LI.Cm G ,
86208987a5SXin LI.Cm g ,
87208987a5SXin LIand
88208987a5SXin LI.Cm %
89208987a5SXin LIconversion characters are valid, along with any optional
90208987a5SXin LIflags and an optional numeric minimum field width or precision.
91208987a5SXin LIThe
92208987a5SXin LI.Ar format
93208987a5SXin LIcan contain character escape sequences in backslash notation as
94208987a5SXin LIdefined in
95208987a5SXin LI.St -ansiC .
96208987a5SXin LIThe default is
97208987a5SXin LI.Cm %g .
98208987a5SXin LI.It Fl s Ar string
99208987a5SXin LIUse
100208987a5SXin LI.Ar string
101208987a5SXin LIto separate numbers.
102208987a5SXin LIThe
103208987a5SXin LI.Ar string
104208987a5SXin LIcan contain character escape sequences in backslash notation as
105208987a5SXin LIdefined in
106208987a5SXin LI.St -ansiC .
107208987a5SXin LIThe default is
108208987a5SXin LI.Cm \en .
109208987a5SXin LI.It Fl t Ar string
110208987a5SXin LIUse
111208987a5SXin LI.Ar string
112208987a5SXin LIto terminate sequence of numbers.
113208987a5SXin LIThe
114208987a5SXin LI.Ar string
115208987a5SXin LIcan contain character escape sequences in backslash notation as
116208987a5SXin LIdefined in
117208987a5SXin LI.St -ansiC .
118208987a5SXin LIThis option is useful when the default separator
119208987a5SXin LIdoes not contain a
120208987a5SXin LI.Cm \en .
121208987a5SXin LI.It Fl w
122208987a5SXin LIEqualize the widths of all numbers by padding with zeros as necessary.
123208987a5SXin LIThis option has no effect with the
124208987a5SXin LI.Fl f
125208987a5SXin LIoption.
126208987a5SXin LIIf any sequence numbers will be printed in exponential notation,
127208987a5SXin LIthe default conversion is changed to
128208987a5SXin LI.Cm %e .
129208987a5SXin LI.El
130208987a5SXin LI.Pp
131208987a5SXin LIThe
132208987a5SXin LI.Nm
133208987a5SXin LIutility exits 0 on success and non-zero if an error occurs.
134208987a5SXin LI.Sh EXAMPLES
135208987a5SXin LI.Bd -literal -offset indent
136208987a5SXin LI# seq 1 3
137208987a5SXin LI1
138208987a5SXin LI2
139208987a5SXin LI3
140208987a5SXin LI
141208987a5SXin LI# seq 3 1
142208987a5SXin LI3
143208987a5SXin LI2
144208987a5SXin LI1
145208987a5SXin LI
146208987a5SXin LI# seq -w 0 .05 .1
147208987a5SXin LI0.00
148208987a5SXin LI0.05
149208987a5SXin LI0.10
150208987a5SXin LI.Ed
151208987a5SXin LI.Sh SEE ALSO
152208987a5SXin LI.Xr jot 1 ,
153208987a5SXin LI.Xr printf 1 ,
154208987a5SXin LI.Xr printf 3
155208987a5SXin LI.Sh HISTORY
156208987a5SXin LIThe
157208987a5SXin LI.Nm
158208987a5SXin LIcommand first appeared in
159208987a5SXin LI.Tn "Plan 9 from Bell Labs" .
160208987a5SXin LIA
161208987a5SXin LI.Nm
162208987a5SXin LIcommand appeared in
163208987a5SXin LI.Nx 3.0 ,
164208987a5SXin LIand ported to
165208987a5SXin LI.Fx 9.0 .
166208987a5SXin LIThis command was based on the command of the same name in
167208987a5SXin LI.Tn "Plan 9 from Bell Labs"
168208987a5SXin LIand the
169208987a5SXin LI.Tn GNU
170208987a5SXin LIcore utilities.
171208987a5SXin LIThe
172208987a5SXin LI.Tn GNU
173208987a5SXin LI.Nm
174208987a5SXin LIcommand first appeared in the 1.13 shell utilities release.
175208987a5SXin LI.Sh BUGS
176208987a5SXin LIThe
177208987a5SXin LI.Fl w
178208987a5SXin LIoption does not handle the transition from pure floating point
179208987a5SXin LIto exponent representation very well.
180208987a5SXin LIThe
181208987a5SXin LI.Nm
182208987a5SXin LIcommand is not bug for bug compatible with the
183208987a5SXin LI.Tn "Plan 9 from Bell Labs"
184208987a5SXin LIor
185208987a5SXin LI.Tn GNU
186208987a5SXin LIversions of
187208987a5SXin LI.Nm .
188