.\"   Copyright (c) 2002 Jessica L. Parsons. All rights reserved.
.\"   
.\"   Redistribution and use in source and binary forms, with or without
.\"   modification, are permitted provided that the following conditions
.\"   are met:
.\"  1. Redistributions of source code must retain the above copyright
.\"     notice, this list of conditions and the following disclaimer.
.\"  2. Redistributions in binary form must reproduce the above copyright
.\"     notice, this list of conditions and the following disclaimer in
.\"     the documentation and/or other materials provided with the
.\"     distribution.
.\"  3. All advertising materials mentioning features or use of this
.\"     software must display the following acknowledgement:
.\"     
.\"   This product includes software developed by Jessica L. Parsons
.\"   (orc@pell.chi.il.us)
.\"
.\"  4. My name may not be used to endorse or promote products derived
.\"     from this software without specific prior written permission.
.\"     
.\"  THIS SOFTWARE IS PROVIDED BY JESSICA L. PARSONS ``AS IS'' AND ANY
.\"  EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
.\"  THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
.\"  PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JESSICA
.\"  PARSONS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
.\"  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
.\"  TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
.\"  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
.\"  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
.\"  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
.\"  IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
.\"  THE POSSIBILITY OF SUCH DAMAGE.
.\"
.TH jot 1 "" "2002/10/06" \" -*- nroff -*-
.SH NAME
jot \- print sequential or random data.
.SH SYNOPSIS
.B jot
.RB [ -cnr ]
.RB [ \-b
.IR word ]
.RB [ \-w
.IR word ]
.RB [ \-s
.IR separator ]
.RB [ \-p
.IR precision ]
.RB [ count
.RB [ begin
.RB [ end
.RB [ s ]]]]
.SH DESCRIPTION
.B jot
prints out increasing, decreasing, or random data, one item per line.

The four arguments 
.BR count ,
.BR begin ,
.BR end ,
and 
.B s
are the number of items to print, the starting point, the ending point,
and the step size.  While at least one of them must appear, any of the
other three may be omitted (giving
.I -
counts) and will be given default values.   The defaults for these
arguments are
.BR count = 100 ,
.BR begin = 1 ,
.BR end = 100 ,
and
.BR s = 1 .
.I count
is expected to be an unsigned integer, and if given as zero is taken
to be infinite.
.I begin
and
.I end
may be given as real numbers or as characters representing the corresponding
value in ASCII.

.B Jot
takes the following options:
.TP
.B \-r
Generate random data instead of sequential data.   If 
.B \-r
is give, the fourth argument is not used as a step size, but as a
.I seed
for the random number generator, and it defaults to a random seed.
.TP
.B \-b\ word
Just print
.I word
repetitively.
.TP
.B \-w word
Print
.I word
with the generated data appended to it.   If the word contains a
.IR printf (3)
conversion specification, the data is instead printed using that
format.
.TP
.B \-c
This is an abbreviation for
.BI \-w \%c\fR.
.TP
.B \-s\ separator
Use 
.I separator
between data elements instead of a newline.
.TP
.B \-n
Do not print the final newline normally appended to the output.
.TP
.B \-p\ precision
Print only as many digits or characters of the data as indicated by the
integer
.IR precision .
In the absence of
.BR \-p ,
the precision is the greated or the precisions of 
.I begin
and
.IR end .
The
.B \-p
option is overwritten by whatever appears in
.B \-w
argument.

.SH EXAMPLES
The command
.nf
jot -b y 0
.fi
prints ``y'' forever.   The ascii character is generated with
.nf
jot -c 128 0
.fi
and the strings xaa through xaz with
.nf
jot -w xa%c 26 a
.fi

The stuttering sequence 9, 9, 8, 8, 7, etc. can be produced by suitable
choice of stepsize, as in
.nf
jot - 9 0 -.5
.fi
(the exact output depends on the vagaries of rounding;  on the FreeBSD
machine I wrote this code on, this command produces
.nf
9, 8, 8, 7 ... 1, 1, 0
.fi
instead of the traditional jot behavior.)

.SH DIAGNOSTICS
.B Jot
returns with failure status if an error occurs.   Most diagnostics
are self-explanatory, but a few need extra explanations:

.TP
.B "illegal or unsupported format '%s'"
The requested conversion format for
.B \-w
was not appropriate.   It needs to be of the form
.nf
%[#] [ ] [{+,-}][0-9]*[.[0-9]*]?
.fi
where 
.I \?
must be one of
.nf
[l]{d,i,io,u,x}
.fi
or
.nf
{c,e,f,g,D,E,G,O,U,X}
.fi

.TP
.B "Too many conversions"
Only one conversion format is allowed in
.BR \-w .

.TP
.B "impossible stepsize"
.I begin
is larger than
.I end
but the step size is less than zero, or visa versa.



.SH AUTHORS
.B Jessica L. Parsons
.RI < orc@pell.chi.il.us >
.br
The random number generator originally appeared in 
.I "Toward a Universal Random Number Generator"
by
.B George Marsaglia
and
.BR "Arif Zaman" .
Florida State University Report: FSU-SCRI-87-50 (1987)
