BSD 4_4_Lite2 development
[unix-history] / usr / share / man / cat1 / jot.0
JOT(1) BSD Reference Manual JOT(1)
N\bNA\bAM\bME\bE
jot - print sequential or random data
S\bSY\bYN\bNO\bOP\bPS\bSI\bIS\bS
j\bjo\bot\bt [\b[ options ]\b] [\b[ reps [\b[ begin [\b[ end [\b[ s ]\b] ]\b] ]\b] ]\b]
D\bDE\bES\bSC\bCR\bRI\bIP\bPT\bTI\bIO\bON\bN
_\bJ_\bo_\bt is used to print out increasing, decreasing, random,
or redundant data, usually numbers, one per line. The
_\bo_\bp_\bt_\bi_\bo_\bn_\bs are understood as follows.
-\b-r\br Generate random data instead of sequential data,
the default.
-\b-b\bb word
Just print _\bw_\bo_\br_\bd repetitively.
-\b-w\bw word
Print _\bw_\bo_\br_\bd with the generated data appended to it.
Octal, hexadecimal, exponential, ASCII, zero
padded, and right-adjusted representations are pos-
sible by using the appropriate _\bp_\br_\bi_\bn_\bt_\bf(3) conversion
specification inside _\bw_\bo_\br_\bd, in which case the data
are inserted rather than appended.
-\b-c\bc This is an abbreviation for -\b-w\bw %\b%c\bc.
-\b-s\bs string
Print data separated by _\bs_\bt_\br_\bi_\bn_\bg. Normally, newlines
separate data.
-\b-n\bn Do not print the final newline normally appended to
the output.
-\b-p\bp precision
Print only as many digits or characters of the data
as indicated by the integer _\bp_\br_\be_\bc_\bi_\bs_\bi_\bo_\bn. In the
absence of -\b-p\bp, the precision is the greater of the
precisions of _\bb_\be_\bg_\bi_\bn and _\be_\bn_\bd. The -\b-p\bp option is
overridden by whatever appears in a _\bp_\br_\bi_\bn_\bt_\bf(3) con-
version following -\b-w\bw.
The last four arguments indicate, respectively, the number
of data, the lower bound, the upper bound, and the step
size or, for random data, the seed. While at least one of
them must appear, any of the other three may be omitted,
and will be considered as such if given as -\b-. Any three
of these arguments determines the fourth. If four are
specified and the given and computed values of _\br_\be_\bp_\bs con-
flict, the lower value is used. If fewer than three are
specified, defaults are assigned left to right, except for
4th Berkeley Distribution June 6, 1993 1
JOT(1) BSD Reference Manual JOT(1)
_\bs, which assumes its default unless both _\bb_\be_\bg_\bi_\bn and _\be_\bn_\bd are
given.
Defaults for the four arguments are, respectively, 100, 1,
100, and 1, except that when random data are requested, _\bs
defaults to a seed depending upon the time of day. _\bR_\be_\bp_\bs
is expected to be an unsigned integer, and if given as
zero is taken to be infinite. _\bB_\be_\bg_\bi_\bn and _\be_\bn_\bd may be given
as real numbers or as characters representing the corre-
sponding value in ASCII. The last argument must be a real
number.
Random numbers are obtained through _\br_\ba_\bn_\bd_\bo_\bm(3). The name
_\bj_\bo_\bt derives in part from _\bi_\bo_\bt_\ba, a function in APL.
E\bEX\bXA\bAM\bMP\bPL\bLE\bES\bS
The command
j\bjo\bot\bt 2\b21\b1 -\b-1\b1 1\b1.\b.0\b00\b0
prints 21 evenly spaced numbers increasing from -1 to 1.
The ASCII character set is generated with
j\bjo\bot\bt -\b-c\bc 1\b12\b28\b8 0\b0
and the strings xaa through xaz with
j\bjo\bot\bt -\b-w\bw x\bxa\ba%\b%c\bc 2\b26\b6 a\ba
while 20 random 8-letter strings are produced with
j\bjo\bot\bt -\b-r\br -\b-c\bc 1\b16\b60\b0 a\ba z\bz |\b| r\brs\bs -\b-g\bg 0\b0 8\b8
Infinitely many _\by_\be_\bs's may be obtained through
j\bjo\bot\bt -\b-b\bb y\bye\bes\bs 0\b0
and thirty _\be_\bd(1) substitution commands applying to lines
2, 7, 12, etc. is the result of
j\bjo\bot\bt -\b-w\bw %\b%d\bds\bs/\b/o\bol\bld\bd/\b/n\bne\bew\bw/\b/ 3\b30\b0 2\b2 -\b- 5\b5
The stuttering sequence 9, 9, 8, 8, 7, etc. can be pro-
duced by suitable choice of precision and step size, as in
j\bjo\bot\bt 0\b0 9\b9 -\b- -\b-.\b.5\b5
and a file containing exactly 1024 bytes is created with
j\bjo\bot\bt -\b-b\bb x\bx 5\b51\b12\b2 >\b> b\bbl\blo\boc\bck\bk
4th Berkeley Distribution June 6, 1993 2
JOT(1) BSD Reference Manual JOT(1)
Finally, to set tabs four spaces apart starting from col-
umn 10 and ending in column 132, use
e\bex\bxp\bpa\ban\bnd\bd -\b-`\b`j\bjo\bot\bt -\b-s\bs,\b, -\b- 1\b10\b0 1\b13\b32\b2 4\b4`\b`
and to print all lines 80 characters or longer,
g\bgr\bre\bep\bp `\b`j\bjo\bot\bt -\b-s\bs "\b""\b" -\b-b\bb .\b. 8\b80\b0`\b`
S\bSE\bEE\bE A\bAL\bLS\bSO\bO
ed(1), expand(1), rs(1), yes(1), printf(3), random(3),
expand(1)
4th Berkeley Distribution June 6, 1993 3