xref: /minix3/usr.bin/jot/jot.1 (revision 075dbe55f35c411d440c66d581a9e79eed791d2f)
1*075dbe55SThomas Cort.\"	$NetBSD: jot.1,v 1.12 2012/04/08 22:00:39 wiz Exp $
2*075dbe55SThomas Cort.\"
3*075dbe55SThomas Cort.\" Copyright (c) 1993
4*075dbe55SThomas Cort.\"	The Regents of the University of California.  All rights reserved.
5*075dbe55SThomas Cort.\"
6*075dbe55SThomas Cort.\" Redistribution and use in source and binary forms, with or without
7*075dbe55SThomas Cort.\" modification, are permitted provided that the following conditions
8*075dbe55SThomas Cort.\" are met:
9*075dbe55SThomas Cort.\" 1. Redistributions of source code must retain the above copyright
10*075dbe55SThomas Cort.\"    notice, this list of conditions and the following disclaimer.
11*075dbe55SThomas Cort.\" 2. Redistributions in binary form must reproduce the above copyright
12*075dbe55SThomas Cort.\"    notice, this list of conditions and the following disclaimer in the
13*075dbe55SThomas Cort.\"    documentation and/or other materials provided with the distribution.
14*075dbe55SThomas Cort.\" 3. Neither the name of the University nor the names of its contributors
15*075dbe55SThomas Cort.\"    may be used to endorse or promote products derived from this software
16*075dbe55SThomas Cort.\"    without specific prior written permission.
17*075dbe55SThomas Cort.\"
18*075dbe55SThomas Cort.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
19*075dbe55SThomas Cort.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20*075dbe55SThomas Cort.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21*075dbe55SThomas Cort.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
22*075dbe55SThomas Cort.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23*075dbe55SThomas Cort.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24*075dbe55SThomas Cort.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25*075dbe55SThomas Cort.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26*075dbe55SThomas Cort.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27*075dbe55SThomas Cort.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28*075dbe55SThomas Cort.\" SUCH DAMAGE.
29*075dbe55SThomas Cort.\"
30*075dbe55SThomas Cort.\"	@(#)jot.1	8.1 (Berkeley) 6/6/93
31*075dbe55SThomas Cort.\"
32*075dbe55SThomas Cort.Dd January 5, 2010
33*075dbe55SThomas Cort.Dt JOT 1
34*075dbe55SThomas Cort.Os
35*075dbe55SThomas Cort.Sh NAME
36*075dbe55SThomas Cort.Nm jot
37*075dbe55SThomas Cort.Nd print sequential or random data
38*075dbe55SThomas Cort.Sh SYNOPSIS
39*075dbe55SThomas Cort.Nm
40*075dbe55SThomas Cort.Op Fl cnr
41*075dbe55SThomas Cort.Op Fl b Ar word
42*075dbe55SThomas Cort.Op Fl p Ar precision
43*075dbe55SThomas Cort.Op Fl s Ar string
44*075dbe55SThomas Cort.Op Fl w Ar word
45*075dbe55SThomas Cort.Oo Ar reps
46*075dbe55SThomas Cort.Oo Ar begin
47*075dbe55SThomas Cort.Oo Ar end
48*075dbe55SThomas Cort.Op Ar s
49*075dbe55SThomas Cort.Oc
50*075dbe55SThomas Cort.Oc
51*075dbe55SThomas Cort.Oc
52*075dbe55SThomas Cort.Sh DESCRIPTION
53*075dbe55SThomas CortThe
54*075dbe55SThomas Cort.Nm jot
55*075dbe55SThomas Cortutility is used to print out increasing, decreasing, random,
56*075dbe55SThomas Cortor redundant data (usually numbers) one per line.
57*075dbe55SThomas Cort.Pp
58*075dbe55SThomas CortThe following options are available:
59*075dbe55SThomas Cort.Bl -tag -width indent
60*075dbe55SThomas Cort.It Fl b Ar word
61*075dbe55SThomas CortJust print
62*075dbe55SThomas Cort.Ar word
63*075dbe55SThomas Cortrepetitively.
64*075dbe55SThomas Cort.It Fl c
65*075dbe55SThomas CortThis is an abbreviation for
66*075dbe55SThomas Cort.Fl w Ar %c .
67*075dbe55SThomas Cort.It Fl n
68*075dbe55SThomas CortDo not print the final newline normally appended to the output.
69*075dbe55SThomas Cort.It Fl p Ar precision
70*075dbe55SThomas CortPrint only as many digits or characters of the data
71*075dbe55SThomas Cortas indicated by the integer
72*075dbe55SThomas Cort.Ar precision .
73*075dbe55SThomas CortIn the absence of
74*075dbe55SThomas Cort.Fl p ,
75*075dbe55SThomas Cortthe precision is the greater of the precisions of
76*075dbe55SThomas Cort.Ar begin
77*075dbe55SThomas Cortand
78*075dbe55SThomas Cort.Ar end .
79*075dbe55SThomas CortThe
80*075dbe55SThomas Cort.Fl p
81*075dbe55SThomas Cortoption is overridden by whatever appears in a
82*075dbe55SThomas Cort.Xr printf 3
83*075dbe55SThomas Cortconversion following
84*075dbe55SThomas Cort.Fl w .
85*075dbe55SThomas Cort.It Fl r
86*075dbe55SThomas CortGenerate random data instead of sequential data, the default.
87*075dbe55SThomas Cort.It Fl s Ar string
88*075dbe55SThomas CortPrint data separated by
89*075dbe55SThomas Cort.Ar string .
90*075dbe55SThomas CortNormally, newlines separate data.
91*075dbe55SThomas Cort.It Fl w Ar word
92*075dbe55SThomas CortPrint
93*075dbe55SThomas Cort.Ar word
94*075dbe55SThomas Cortwith the generated data appended to it.
95*075dbe55SThomas CortOctal, hexadecimal, exponential, ASCII, zero padded,
96*075dbe55SThomas Cortand right-adjusted representations
97*075dbe55SThomas Cortare possible by using the appropriate
98*075dbe55SThomas Cort.Xr printf 3
99*075dbe55SThomas Cortconversion specification inside
100*075dbe55SThomas Cort.Ar word ,
101*075dbe55SThomas Cortin which case the data are inserted rather than appended.
102*075dbe55SThomas Cort.El
103*075dbe55SThomas Cort.Pp
104*075dbe55SThomas CortThe last four arguments indicate, respectively,
105*075dbe55SThomas Cortthe number of data, the lower bound, the upper bound,
106*075dbe55SThomas Cortand the step size or, for random data, the seed.
107*075dbe55SThomas CortWhile at least one of them must appear,
108*075dbe55SThomas Cortany of the other three may be omitted, and
109*075dbe55SThomas Cortwill be considered as such if given as
110*075dbe55SThomas Cort.Dq - .
111*075dbe55SThomas CortAny three of these arguments determines the fourth.
112*075dbe55SThomas CortIf four are specified and the given and computed values of
113*075dbe55SThomas Cort.Ar reps
114*075dbe55SThomas Cortconflict, the lower value is used.
115*075dbe55SThomas CortIf fewer than three are specified, defaults are assigned
116*075dbe55SThomas Cortleft to right, except for
117*075dbe55SThomas Cort.Ar s ,
118*075dbe55SThomas Cortwhich assumes its default unless both
119*075dbe55SThomas Cort.Ar begin
120*075dbe55SThomas Cortand
121*075dbe55SThomas Cort.Ar end
122*075dbe55SThomas Cortare given.
123*075dbe55SThomas Cort.Pp
124*075dbe55SThomas CortDefaults for the four arguments are, respectively,
125*075dbe55SThomas Cort100, 1, 100, and 1, except that when random data are requested,
126*075dbe55SThomas Cort.Ar s
127*075dbe55SThomas Cortdefaults to a seed depending upon the time of day.
128*075dbe55SThomas Cort.Ar reps
129*075dbe55SThomas Cortis expected to be an unsigned integer,
130*075dbe55SThomas Cortand if given as zero is taken to be infinite.
131*075dbe55SThomas Cort.Ar begin
132*075dbe55SThomas Cortand
133*075dbe55SThomas Cort.Ar end
134*075dbe55SThomas Cortmay be given as real numbers or as characters
135*075dbe55SThomas Cortrepresenting the corresponding value in ASCII.
136*075dbe55SThomas CortThe last argument must be a real number.
137*075dbe55SThomas Cort.Pp
138*075dbe55SThomas CortRandom numbers are obtained through
139*075dbe55SThomas Cort.Xr random 3 .
140*075dbe55SThomas CortThe name
141*075dbe55SThomas Cort.Nm jot
142*075dbe55SThomas Cortderives in part from
143*075dbe55SThomas Cort.Nm iota ,
144*075dbe55SThomas Corta function in APL.
145*075dbe55SThomas Cort.Sh EXAMPLES
146*075dbe55SThomas CortThe command:
147*075dbe55SThomas Cort.Dl "jot - 42 87 1"
148*075dbe55SThomas Cortprints the integers from 42 to 87, inclusive.
149*075dbe55SThomas Cort.Pp
150*075dbe55SThomas CortThe command:
151*075dbe55SThomas Cort.Dl "jot 21 \-1 1.00"
152*075dbe55SThomas Cortprints 21 evenly spaced numbers increasing from \-1 to 1.
153*075dbe55SThomas Cort.Pp
154*075dbe55SThomas CortThe command:
155*075dbe55SThomas Cort.Dl "jot \-c 128 0"
156*075dbe55SThomas Cortprints the ASCII character set.
157*075dbe55SThomas Cort.Pp
158*075dbe55SThomas CortThe command:
159*075dbe55SThomas Cort.Dl "jot \-w xa%c 26 a"
160*075dbe55SThomas Cortprints the strings
161*075dbe55SThomas Cort.Dq xaa
162*075dbe55SThomas Cortthrough
163*075dbe55SThomas Cort.Dq xaz .
164*075dbe55SThomas Cort.Pp
165*075dbe55SThomas CortThe command:
166*075dbe55SThomas Cort.Dl "jot \-r \-c 160 a z | rs \-g 0 8"
167*075dbe55SThomas Cortprints 20 random 8-letter strings.
168*075dbe55SThomas Cort.Pp
169*075dbe55SThomas CortThe command:
170*075dbe55SThomas Cort.Dl "jot \-b y 0"
171*075dbe55SThomas Cortis equivalent to
172*075dbe55SThomas Cort.Xr yes 1 .
173*075dbe55SThomas Cort.Pp
174*075dbe55SThomas CortThe command:
175*075dbe55SThomas Cort.Dl "jot \-w %ds/old/new/ 30 2 \- 5"
176*075dbe55SThomas Cortprints thirty
177*075dbe55SThomas Cort.Xr ed 1
178*075dbe55SThomas Cortsubstitution commands applying to lines 2, 7, 12, etc.
179*075dbe55SThomas Cort.Pp
180*075dbe55SThomas CortThe command:
181*075dbe55SThomas Cort.Dl "jot 0 9 \- \-.5"
182*075dbe55SThomas Cortprints the stuttering sequence 9, 8, 8, 7, etc.
183*075dbe55SThomas Cort.Pp
184*075dbe55SThomas CortThe command:
185*075dbe55SThomas Cort.Dl "jot \-b x 512 \*[Gt] block"
186*075dbe55SThomas Cortcreates a file containing exactly 1024 bytes.
187*075dbe55SThomas Cort.Pp
188*075dbe55SThomas CortThe command:
189*075dbe55SThomas Cort.Dl "expand \-\`jot \-s, \- 10 132 4\`"
190*075dbe55SThomas Cortsets tabs four spaces apart starting
191*075dbe55SThomas Cortfrom column 10 and ending in column 132.
192*075dbe55SThomas Cort.Pp
193*075dbe55SThomas CortThe command:
194*075dbe55SThomas Cort.Dl "grep \`jot \-s """" \-b . 80\`"
195*075dbe55SThomas Cortprints all lines 80 characters or longer.
196*075dbe55SThomas Cort.Sh SEE ALSO
197*075dbe55SThomas Cort.Xr ed 1 ,
198*075dbe55SThomas Cort.Xr expand 1 ,
199*075dbe55SThomas Cort.Xr rs 1 ,
200*075dbe55SThomas Cort.Xr seq 1 ,
201*075dbe55SThomas Cort.Xr yes 1 ,
202*075dbe55SThomas Cort.Xr printf 3 ,
203*075dbe55SThomas Cort.Xr random 3
204