]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - usr.bin/jot/jot.1
This commit was generated by cvs2svn to compensate for changes in r99160,
[FreeBSD/FreeBSD.git] / usr.bin / jot / jot.1
1 .\" Copyright (c) 1993
2 .\"     The Regents of the University of California.  All rights reserved.
3 .\"
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
6 .\" are met:
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\"    notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\"    notice, this list of conditions and the following disclaimer in the
11 .\"    documentation and/or other materials provided with the distribution.
12 .\" 3. All advertising materials mentioning features or use of this software
13 .\"    must display the following acknowledgement:
14 .\"     This product includes software developed by the University of
15 .\"     California, Berkeley and its contributors.
16 .\" 4. Neither the name of the University nor the names of its contributors
17 .\"    may be used to endorse or promote products derived from this software
18 .\"    without specific prior written permission.
19 .\"
20 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 .\" SUCH DAMAGE.
31 .\"
32 .\"     @(#)jot.1       8.1 (Berkeley) 6/6/93
33 .\" $FreeBSD$
34 .\"
35 .Dd June 6, 1993
36 .Dt JOT 1
37 .Os
38 .Sh NAME
39 .Nm jot
40 .Nd print sequential or random data
41 .Sh SYNOPSIS
42 .Nm
43 .Op Fl cnr
44 .Op Fl b Ar word
45 .Op Fl w Ar word
46 .Op Fl s Ar string
47 .Op Fl p Ar precision
48 .Op reps Op begin Op end Op s
49 .Sh DESCRIPTION
50 The
51 .Nm
52 utility is used to print out increasing, decreasing, random,
53 or redundant data, usually numbers, one per line.
54 .Pp
55 The following options are available:
56 .Bl -tag -width indent
57 .It Fl r
58 Generate random data instead of the default sequential data.
59 .It Fl b Ar word
60 Just print
61 .Ar word
62 repetitively.
63 .It Fl w Ar word
64 Print
65 .Ar word
66 with the generated data appended to it.
67 Octal, hexadecimal, exponential,
68 .Tn ASCII ,
69 zero padded,
70 and right-adjusted representations
71 are possible by using the appropriate
72 .Xr printf 3
73 conversion specification inside
74 .Ar word ,
75 in which case the data are inserted rather than appended.
76 .It Fl c
77 This is an abbreviation for
78 .Fl w Ar %c .
79 .It Fl s Ar string
80 Print data separated by
81 .Ar string .
82 Normally, newlines separate data.
83 .It Fl n
84 Do not print the final newline normally appended to the output.
85 .It Fl p Ar precision
86 Print only as many digits or characters of the data
87 as indicated by the integer
88 .Ar precision .
89 In the absence of
90 .Fl p ,
91 the precision is the greater of the precisions of
92 .Ar begin
93 and
94 .Ar end .
95 The
96 .Fl p
97 option is overridden by whatever appears in a
98 .Xr printf 3
99 conversion following
100 .Fl w .
101 .El
102 .Pp
103 The last four arguments indicate, respectively,
104 the number of data, the lower bound, the upper bound,
105 and the step size or, for random data, the seed.
106 While at least one of them must appear,
107 any of the other three may be omitted, and
108 will be considered as such if given as
109 .Fl "" .
110 Any three of these arguments determines the fourth.
111 If four are specified and the given and computed values of
112 .Ar reps
113 conflict, the lower value is used.
114 If fewer than three are specified, defaults are assigned
115 left to right, except for
116 .Ar s ,
117 which assumes its default unless both
118 .Ar begin
119 and
120 .Ar end
121 are given.
122 .Pp
123 Defaults for the four arguments are, respectively,
124 100, 1, 100, and 1, except that when random data are requested,
125 the seed,
126 .Ar s ,
127 is picked randomly.
128 .Ar Reps
129 is expected to be an unsigned integer,
130 and if given as zero is taken to be infinite.
131 .Ar Begin
132 and
133 .Ar end
134 may be given as real numbers or as characters
135 representing the corresponding value in
136 .Tn ASCII .
137 The last argument must be a real number.
138 .Pp
139 Random numbers are obtained through
140 .Xr random 3 .
141 The name
142 .Nm
143 derives in part from
144 .Nm iota ,
145 a function in APL.
146 .Sh EXAMPLES
147 The command
148 .Dl jot 21 -1 1.00
149 .Pp
150 prints 21 evenly spaced numbers increasing from -1 to 1.
151 The
152 .Tn ASCII
153 character set is generated with
154 .Dl jot -c 128 0
155 .Pp
156 and the strings xaa through xaz with
157 .Dl jot -w xa%c 26 a
158 .Pp
159 while 20 random 8-letter strings are produced with
160 .Dl "jot -r -c 160 a z | rs -g 0 8"
161 .Pp
162 Infinitely many
163 .Em yes Ns 's
164 may be obtained through
165 .Dl jot -b yes 0
166 .Pp
167 and thirty
168 .Xr ed 1
169 substitution commands applying to lines 2, 7, 12, etc. is
170 the result of
171 .Dl jot -w %ds/old/new/ 30 2 - 5
172 .Pp
173 The stuttering sequence 9, 9, 8, 8, 7, etc. can be
174 produced by suitable choice of step size,
175 as in
176 .Dl jot - 9 0 -.5
177 .Pp
178 and a file containing exactly 1024 bytes is created with
179 .Dl jot -b x 512 > block
180 .Pp
181 Finally, to set tabs four spaces apart starting
182 from column 10 and ending in column 132, use
183 .Dl expand -`jot -s, - 10 132 4`
184 .Pp
185 and to print all lines 80 characters or longer,
186 .Dl grep `jot -s \&"\&" -b \&. 80`
187 .Sh DIAGNOSTICS
188 .Ex -std
189 The following diagnostic messages deserve special explanation:
190 .Bl -diag
191 .It "illegal or unsupported format '%s'"
192 The requested conversion format specifier for
193 .Xr printf 3
194 was not of the form
195 .Dl %[#][ ][{+,-}][0-9]*[.[0-9]*]?
196 where
197 .Dq ?\&
198 must be one of
199 .Dl [l]{d,i,o,u,x}
200 or
201 .Dl {c,e,f,g,D,E,G,O,U,X}
202 .It "range error in conversion"
203 A value to be printed fell outside the range of the data type
204 associated with the requested output format.
205 .It "too many conversions"
206 More than one conversion format specifier has been supplied,
207 but only one is allowed.
208 .El
209 .Sh SEE ALSO
210 .Xr ed 1 ,
211 .Xr expand 1 ,
212 .Xr rs 1 ,
213 .Xr yes 1 ,
214 .Xr printf 3 ,
215 .Xr random 3