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