Skip to content

Latest commit

 

History

History
78 lines (63 loc) · 2.19 KB

manual.asciidoc

File metadata and controls

78 lines (63 loc) · 2.19 KB

RANDOM(1)

Philip Puryear <[email protected]> :doctype: manpage :man source: random :man version: git :man manual: User Commands

NAME

random - print a random number to the console

SYNOPSIS
--------
*random* ['OPTIONS'] ['LOWERBOUND'] ['UPPERBOUND']

DESCRIPTION
-----------
The *random* command prints a uniformly-distributed random integer to the
console. The range of the printed number is ['LOWERBOUND', 'UPPERBOUND'),
where 'LOWERBOUND' and 'UPPERBOUND' are integers. If only one bound is given,
the range [0, 'BOUND') is used. If no bounds are given, the range [0, 32768)
is used.

*random* reads all random data directly from the system PRNG (by default,
/dev/urandom on POSIX systems) and formats it as a printable number. It
performs no random number generation on its own.

OPTIONS
-------
*-b, --base*='BASE'::
    Print the output in the given base, where 'BASE' is in one of the following
    ranges:
[horizontal]
    *2..36*;; decimal digits, lowercase letters
    *-2..-36*;; decimal digits, uppercase letters
    *37..62*;; decimal digits, uppercase letters, lowercase letters

*-r, --use-random*::
    On POSIX systems, read random data from /dev/random instead of /dev/urandom.

*-h, --help*::
    Print the help text.

*-s, --size*='SIZE'::
    Specify the size of the output in bits. If this option is specified, then
    the output range is taken to be [0, 2^'SIZE'). This option cannot be used if
    either 'LOWERBOUND' or 'UPPERBOUND' is provided on the command-line.

EXIT STATUS
-----------
[horizontal]
*0*:: Success.
*1*:: Failure.

RESOURCES
---------
GitHub: <https://github.com/ppuryear/random/>

SEE ALSO
--------
*rand*(1)