1 .\" $NetBSD: seq.1,v 1.8 2013/04/07 17:37:45 jdf Exp $
3 .\" Copyright (c) 2005 The NetBSD Foundation, Inc.
4 .\" All rights reserved.
6 .\" This code is derived from software contributed to The NetBSD Foundation
9 .\" Redistribution and use in source and binary forms, with or without
10 .\" modification, are permitted provided that the following conditions
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.
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.
35 .Nd print sequences of numbers
42 .Op Ar first Op Ar incr
47 utility prints a sequence of numbers, one per line
54 as possible, in increments of
65 All numbers are interpreted as floating point.
67 Normally integer values are printed as decimal integers.
71 utility accepts the following options:
73 .It Fl f Ar format , Fl -format Ar format
90 conversion characters are valid, along with any optional
91 flags and an optional numeric minimum field width or precision.
94 can contain character escape sequences in backslash notation as
99 .It Fl s Ar string , Fl -separator Ar string
105 can contain character escape sequences in backslash notation as
110 .It Fl t Ar string , Fl -terminator Ar string
113 to terminate sequence of numbers.
116 can contain character escape sequences in backslash notation as
119 This option is useful when the default separator
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
127 If any sequence numbers will be printed in exponential notation,
128 the default conversion is changed to
134 Generate a sequence from 1 to 3 (included) with a default increment of 1:
135 .Bd -literal -offset indent
142 Generate a sequence from 3 to 1 (included) with a default increment of -1:
143 .Bd -literal -offset indent
150 Generate a sequence from 0 to 0.1 (included) with an increment of 0.05 and padding
152 .Bd -literal -offset indent
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]
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
170 .Bd -literal -offset indent
171 # seq -f %.2f 1 0.2 2
186 command first appeared in Version\~8
194 This command was based on the command of the same name in
195 Plan 9 from Bell Labs and the GNU core utilities.
198 command first appeared in the 1.13 shell utilities release.
202 option does not handle the transition from pure floating point
203 to exponent representation very well.
206 command is not bug for bug compatible with other implementations.