1 .\" SPDX-License-Identifier: BSD-2-Clause
3 .\" Copyright (c) 2022 Alessio Chiapperini
5 .\" Redistribution and use in source and binary forms, with or without
6 .\" modification, are permitted provided that the following conditions
8 .\" 1. Redistributions of source code must retain the above copyright
9 .\" notice, this list of conditions and the following disclaimer.
10 .\" 2. Redistributions in binary form must reproduce the above copyright
11 .\" notice, this list of conditions and the following disclaimer in the
12 .\" documentation and/or other materials provided with the distribution.
14 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 .Nd print a sequence of numbers or characters
49 utility prints numbers or characters from
57 is omitted, it defaults to either 1 or -1 depending on whether
62 The sequence ends when the sum of the current element and
64 would become greater than
70 are interpreted as signed integer values.
72 is usually positive if
78 is usually negative if
83 must be different than 0.
85 The options are as follows:
86 .Bl -tag -width indent
88 Print usage information and exit.
92 as the field delimiter in the sequence instead of
97 as the sequence terminator.
102 utility exits 0 on success, and 1 if an error occurs.
104 Print the sequence of even numbers from 0 to 100:
105 .Bd -literal -offset ident
109 Print the sequence of letters a-z separated by a comma:
110 .Bd -literal -offset ident
115 Print the sequence of numbers from 10 to 5 with a default decrement of -1:
117 .Bd -literal -offset ident
122 Print the sequence of numbers from 1 to 10 separated by a horizontal tab and
123 terminated with a newline:
124 .Bd -literal -offset ident
125 $ range -s "\\t" -t "\\n" 1 10
131 The minimum and maximum values for the
136 parameters are INT_MIN and INT_MAX respectively.
138 .An Alessio Chiapperini Aq Mt alessio.chiapperini@\:nullbuffer.com