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