]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - usr.bin/seq/seq.1
pmap: move the smp_targeted_tlb_shutdown pointer stuff to amd64 pmap.h
[FreeBSD/FreeBSD.git] / usr.bin / seq / seq.1
1 .\"     $NetBSD: seq.1,v 1.8 2013/04/07 17:37:45 jdf 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 .Dd June 20, 2020
31 .Dt SEQ 1
32 .Os
33 .Sh NAME
34 .Nm seq
35 .Nd print sequences of numbers
36 .Sh SYNOPSIS
37 .Nm
38 .Op Fl w
39 .Op Fl f Ar format
40 .Op Fl s Ar string
41 .Op Fl t Ar string
42 .Op Ar first Op Ar incr
43 .Ar last
44 .Sh DESCRIPTION
45 The
46 .Nm
47 utility prints a sequence of numbers, one per line
48 .Pq default ,
49 from
50 .Ar first
51 .Pq default 1 ,
52 to near
53 .Ar last
54 as possible, in increments of
55 .Ar incr
56 .Pq default 1 .
57 When
58 .Ar first
59 is larger than
60 .Ar last ,
61 the default
62 .Ar incr
63 is -1.
64 .Pp
65 All numbers are interpreted as floating point.
66 .Pp
67 Normally integer values are printed as decimal integers.
68 .Pp
69 The
70 .Nm
71 utility accepts the following options:
72 .Bl -tag -width Ar
73 .It Fl f Ar format , Fl -format Ar format
74 Use a
75 .Xr printf 3
76 style
77 .Ar format
78 to print each number.
79 Only the
80 .Cm A ,
81 .Cm a ,
82 .Cm E ,
83 .Cm e ,
84 .Cm F ,
85 .Cm f ,
86 .Cm G ,
87 .Cm g ,
88 and
89 .Cm %
90 conversion characters are valid, along with any optional
91 flags and an optional numeric minimum field width or precision.
92 The
93 .Ar format
94 can contain character escape sequences in backslash notation as
95 defined in
96 .St -ansiC .
97 The default is
98 .Cm %g .
99 .It Fl s Ar string , Fl -separator Ar string
100 Use
101 .Ar string
102 to separate numbers.
103 The
104 .Ar string
105 can contain character escape sequences in backslash notation as
106 defined in
107 .St -ansiC .
108 The default is
109 .Cm \en .
110 .It Fl t Ar string , Fl -terminator Ar string
111 Use
112 .Ar string
113 to terminate sequence of numbers.
114 The
115 .Ar string
116 can contain character escape sequences in backslash notation as
117 defined in
118 .St -ansiC .
119 This option is useful when the default separator
120 does not contain a
121 .Cm \en .
122 .It Fl w , Fl -fixed-width
123 Equalize the widths of all numbers by padding with zeros as necessary.
124 This option has no effect with the
125 .Fl f
126 option.
127 If any sequence numbers will be printed in exponential notation,
128 the default conversion is changed to
129 .Cm %e .
130 .El
131 .Sh EXIT STATUS
132 .Ex -std
133 .Sh EXAMPLES
134 Generate a sequence from 1 to 3 (included) with a default increment of 1:
135 .Bd -literal -offset indent
136 # seq 1 3
137 1
138 2
139 3
140 .Ed
141 .Pp
142 Generate a sequence from 3 to 1 (included) with a default increment of -1:
143 .Bd -literal -offset indent
144 # seq 3 1
145 3
146 2
147 1
148 .Ed
149 .Pp
150 Generate a sequence from 0 to 0.1 (included) with an increment of 0.05 and padding
151 with leading zeroes.
152 .Bd -literal -offset indent
153 # seq -w 0 .05 .1
154 0.00
155 0.05
156 0.10
157 .Ed
158 .Pp
159 Generate a sequence from 1 to 3 (included) with a default increment of 1,
160 a custom separator string and a custom terminator:
161 .Bd -literal -offset indent
162 # seq -s "-->" -t "[end of list]\\n" 1 3
163 1-->2-->3-->[end of list]
164 .Ed
165 .Pp
166 Generate a sequence from 1 to 2 (included) with an increment of 0.2 and
167 print the results with two digits after the decimal point (using a
168 .Xr printf 3
169 style format):
170 .Bd -literal -offset indent
171 # seq -f %.2f 1 0.2 2
172 1.00
173 1.20
174 1.40
175 1.60
176 1.80
177 2.00
178 .Ed
179 .Sh SEE ALSO
180 .Xr jot 1 ,
181 .Xr printf 1 ,
182 .Xr printf 3
183 .Sh HISTORY
184 The
185 .Nm
186 command first appeared in Version\~8
187 .At .
188 A
189 .Nm
190 command appeared in
191 .Nx 3.0 ,
192 and was ported to
193 .Fx 9.0 .
194 This command was based on the command of the same name in
195 Plan 9 from Bell Labs and the GNU core utilities.
196 The GNU
197 .Nm
198 command first appeared in the 1.13 shell utilities release.
199 .Sh BUGS
200 The
201 .Fl w
202 option does not handle the transition from pure floating point
203 to exponent representation very well.
204 The
205 .Nm
206 command is not bug for bug compatible with other implementations.