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 |
---|
39 | jot \- print sequential or random data |
---|
40 | .SH SYNOPSIS |
---|
41 | .B jot [ |
---|
42 | options |
---|
43 | .B ] [ |
---|
44 | \fRreps \fB[\fP begin \fB[\fP end \fB[\fP s \fB] ] ] ]\fP |
---|
45 | .SH DESCRIPTION |
---|
46 | .I Jot |
---|
47 | is used to print out increasing, decreasing, random, |
---|
48 | or redundant data, usually numbers, one per line. |
---|
49 | The |
---|
50 | .I options |
---|
51 | are understood as follows. |
---|
52 | .IP \fB\-r\fP |
---|
53 | Generate random data instead of sequential data, the default. |
---|
54 | .IP \fB\-b\fP\ word |
---|
55 | Just print |
---|
56 | .I word |
---|
57 | repetitively. |
---|
58 | .IP \fB\-w\fP\ word |
---|
59 | Print |
---|
60 | .IR word |
---|
61 | with the generated data appended to it. |
---|
62 | Octal, hexadecimal, exponential, ASCII, zero padded, |
---|
63 | and right-adjusted representations |
---|
64 | are possible by using the appropriate |
---|
65 | .IR printf (3) |
---|
66 | conversion specification inside |
---|
67 | .IR word , |
---|
68 | in which case the data are inserted rather than appended. |
---|
69 | .IP \fB\-c\fP |
---|
70 | This is an abbreviation for \fB\-w %c\fP. |
---|
71 | .IP \fB\-s\fP\ string |
---|
72 | Print data separated by |
---|
73 | .IR string . |
---|
74 | Normally, newlines separate data. |
---|
75 | .IP \fB\-n\fP |
---|
76 | Do not print the final newline normally appended to the output. |
---|
77 | .IP \fB\-p\fP\ precision |
---|
78 | Print only as many digits or characters of the data |
---|
79 | as indicated by the integer |
---|
80 | .IR precision . |
---|
81 | In the absence of |
---|
82 | .BR \-p , |
---|
83 | the precision is the greater of the precisions of |
---|
84 | .I begin |
---|
85 | and |
---|
86 | .IR end . |
---|
87 | The |
---|
88 | .B \-p |
---|
89 | option is overridden by whatever appears in a |
---|
90 | .IR printf (3) |
---|
91 | conversion following |
---|
92 | .BR \-w . |
---|
93 | .PP |
---|
94 | The last four arguments indicate, respectively, |
---|
95 | the number of data, the lower bound, the upper bound, |
---|
96 | and the step size or, for random data, the seed. |
---|
97 | While at least one of them must appear, |
---|
98 | any of the other three may be omitted, and |
---|
99 | will be considered as such if given as |
---|
100 | .BR \- . |
---|
101 | Any three of these arguments determines the fourth. |
---|
102 | If four are specified and the given and computed values of |
---|
103 | .I reps |
---|
104 | conflict, the lower value is used. |
---|
105 | If fewer than three are specified, defaults are assigned |
---|
106 | left to right, except for |
---|
107 | .IR s , |
---|
108 | which assumes its default unless both |
---|
109 | .I begin |
---|
110 | and |
---|
111 | .I end |
---|
112 | are given. |
---|
113 | .PP |
---|
114 | Defaults for the four arguments are, respectively, |
---|
115 | 100, 1, 100, and 1, except that when random data are requested, |
---|
116 | .I s |
---|
117 | defaults to a seed depending upon the time of day. |
---|
118 | .I Reps |
---|
119 | is expected to be an unsigned integer, |
---|
120 | and if given as zero is taken to be infinite. |
---|
121 | .I Begin |
---|
122 | and |
---|
123 | .I end |
---|
124 | may be given as real numbers or as characters |
---|
125 | representing the corresponding value in ASCII. |
---|
126 | The last argument must be a real number. |
---|
127 | .PP |
---|
128 | Random numbers are obtained through |
---|
129 | .IR random (3). |
---|
130 | The name |
---|
131 | .I jot |
---|
132 | derives in part from |
---|
133 | .IR iota , |
---|
134 | a 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 |
---|
147 | The command |
---|
148 | .IC |
---|
149 | jot 21 \-1 1.00 |
---|
150 | .NC |
---|
151 | prints 21 evenly spaced numbers increasing from \-1 to 1. |
---|
152 | The ASCII character set is generated with |
---|
153 | .IC |
---|
154 | jot \-c 128 0 |
---|
155 | .NC |
---|
156 | and the strings xaa through xaz with |
---|
157 | .IC |
---|
158 | jot \-w xa%c 26 a |
---|
159 | .NC |
---|
160 | while 20 random 8-letter strings are produced with |
---|
161 | .IC |
---|
162 | jot \-r \-c 160 a z | rs \-g 0 8 |
---|
163 | .NC |
---|
164 | Infinitely many |
---|
165 | .IR yes 's |
---|
166 | may be obtained through |
---|
167 | .IC |
---|
168 | jot \-b yes 0 |
---|
169 | .NC |
---|
170 | and thirty |
---|
171 | .IR ed (1) |
---|
172 | substitution commands applying to lines 2, 7, 12, etc. is |
---|
173 | the result of |
---|
174 | .IC |
---|
175 | jot \-w %ds/old/new/ 30 2 \- 5 |
---|
176 | .NC |
---|
177 | The stuttering sequence 9, 9, 8, 8, 7, etc. can be |
---|
178 | produced by suitable choice of precision and step size, |
---|
179 | as in |
---|
180 | .IC |
---|
181 | jot 0 9 \- \-.5 |
---|
182 | .NC |
---|
183 | and a file containing exactly 1024 bytes is created with |
---|
184 | .IC |
---|
185 | jot \-b x 512 > block |
---|
186 | .NC |
---|
187 | Finally, to set tabs four spaces apart starting |
---|
188 | from column 10 and ending in column 132, use |
---|
189 | .IC |
---|
190 | expand \-\`jot \-s, \- 10 132 4\` |
---|
191 | .NC |
---|
192 | and to print all lines 80 characters or longer, |
---|
193 | .IC |
---|
194 | grep \`jot \-s "" \-b . 80\` |
---|
195 | .NC |
---|
196 | .SH SEE ALSO |
---|
197 | ed(1), expand(1), rs(1), yes(1), printf(3), random(3), expand(1) |
---|