source: trunk/third/jot/jot.1 @ 9071

Revision 9071, 5.4 KB checked in by ghudson, 28 years ago (diff)
This commit was generated by cvs2svn to compensate for changes in r9070, which included commits to RCS files with non-trunk default branches.
Line 
1.\"     $NetBSD: jot.1,v 1.2 1994/11/14 20:27:36 jtc Exp $
2.\"
3.\" Copyright (c) 1993
4.\"     The Regents of the University of California.  All rights reserved.
5.\"
6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions
8.\" are met:
9.\" 1. Redistributions of source code must retain the above copyright
10.\"    notice, this list of conditions and the following disclaimer.
11.\" 2. Redistributions in binary form must reproduce the above copyright
12.\"    notice, this list of conditions and the following disclaimer in the
13.\"    documentation and/or other materials provided with the distribution.
14.\" 3. All advertising materials mentioning features or use of this software
15.\"    must display the following acknowledgement:
16.\"     This product includes software developed by the University of
17.\"     California, Berkeley and its contributors.
18.\" 4. Neither the name of the University nor the names of its contributors
19.\"    may be used to endorse or promote products derived from this software
20.\"    without specific prior written permission.
21.\"
22.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
23.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
26.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32.\" SUCH DAMAGE.
33.\"
34.\"     @(#)jot.1       8.1 (Berkeley) 6/6/93
35.\"
36.TH JOT 1 "June 6, 1993"
37.UC 4
38.SH NAME
39jot \- print sequential or random data
40.SH SYNOPSIS
41.B jot [
42options
43.B ] [
44\fRreps \fB[\fP begin \fB[\fP end \fB[\fP s \fB] ] ] ]\fP
45.SH DESCRIPTION
46.I Jot
47is used to print out increasing, decreasing, random,
48or redundant data, usually numbers, one per line.
49The
50.I options
51are understood as follows.
52.IP \fB\-r\fP
53Generate random data instead of sequential data, the default.
54.IP \fB\-b\fP\ word
55Just print
56.I word
57repetitively.
58.IP \fB\-w\fP\ word
59Print
60.IR word
61with the generated data appended to it.
62Octal, hexadecimal, exponential, ASCII, zero padded,
63and right-adjusted representations
64are possible by using the appropriate
65.IR printf (3)
66conversion specification inside
67.IR word ,
68in which case the data are inserted rather than appended.
69.IP \fB\-c\fP
70This is an abbreviation for \fB\-w %c\fP.
71.IP \fB\-s\fP\ string
72Print data separated by
73.IR string .
74Normally, newlines separate data.
75.IP \fB\-n\fP
76Do not print the final newline normally appended to the output.
77.IP \fB\-p\fP\ precision
78Print only as many digits or characters of the data
79as indicated by the integer
80.IR precision .
81In the absence of
82.BR \-p ,
83the precision is the greater of the precisions of
84.I begin
85and
86.IR end .
87The
88.B \-p
89option is overridden by whatever appears in a
90.IR printf (3)
91conversion following
92.BR \-w .
93.PP
94The last four arguments indicate, respectively,
95the number of data, the lower bound, the upper bound,
96and the step size or, for random data, the seed.
97While at least one of them must appear,
98any of the other three may be omitted, and
99will be considered as such if given as
100.BR \- .
101Any three of these arguments determines the fourth.
102If four are specified and the given and computed values of
103.I reps
104conflict, the lower value is used.
105If fewer than three are specified, defaults are assigned
106left to right, except for
107.IR s ,
108which assumes its default unless both
109.I begin
110and
111.I end
112are given.
113.PP
114Defaults for the four arguments are, respectively,
115100, 1, 100, and 1, except that when random data are requested,
116.I s
117defaults to a seed depending upon the time of day.
118.I Reps
119is expected to be an unsigned integer,
120and if given as zero is taken to be infinite.
121.I Begin
122and
123.I end
124may be given as real numbers or as characters
125representing the corresponding value in ASCII.
126The last argument must be a real number.
127.PP
128Random numbers are obtained through
129.IR random (3).
130The name
131.I jot
132derives in part from
133.IR iota ,
134a function in APL.
135.SH EXAMPLES
136.de IC
137.IP
138.ss 36
139.ft B
140..
141.de NC
142.br
143.ss 12
144.PP
145..
146.PP
147The command
148.IC
149jot 21 \-1 1.00
150.NC
151prints 21 evenly spaced numbers increasing from \-1 to 1.
152The ASCII character set is generated with
153.IC
154jot \-c 128 0
155.NC
156and the strings xaa through xaz with
157.IC
158jot \-w xa%c 26 a
159.NC
160while 20 random 8-letter strings are produced with
161.IC
162jot \-r \-c 160 a z | rs \-g 0 8
163.NC
164Infinitely many
165.IR yes 's
166may be obtained through
167.IC
168jot \-b yes 0
169.NC
170and thirty
171.IR ed (1)
172substitution commands applying to lines 2, 7, 12, etc. is
173the result of
174.IC
175jot \-w %ds/old/new/ 30 2 \- 5
176.NC
177The stuttering sequence 9, 9, 8, 8, 7, etc. can be
178produced by suitable choice of precision and step size,
179as in
180.IC
181jot 0 9 \- \-.5
182.NC
183and a file containing exactly 1024 bytes is created with
184.IC
185jot \-b x 512 > block
186.NC
187Finally, to set tabs four spaces apart starting
188from column 10 and ending in column 132, use
189.IC
190expand \-\`jot \-s, \- 10 132 4\`
191.NC
192and to print all lines 80 characters or longer,
193.IC
194grep \`jot \-s "" \-b . 80\`
195.NC
196.SH SEE ALSO
197ed(1), expand(1), rs(1), yes(1), printf(3), random(3), expand(1)
Note: See TracBrowser for help on using the repository browser.