summaryrefslogtreecommitdiff
path: root/static/v10/man1/random.1
blob: f4623cda9a8a319ff2050f7b443c90a809fc8f9a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
.TH RANDOM 1
.CT 1 files games
.SH NAME
random, fortune \- sample lines from a file, return cookies
.SH SYNOPSIS
.B random
[
.B -e
]
[
.I n
]
.PP
.B /usr/games/fortune
[
.I file
]
.SH DESCRIPTION
.I Random
reads the standard input and copies each line to the
standard output with probability
.RI 1/ n.
The default value of
.I n
is 2.
.PP
Option
.B -e
writes no output and returns a random exit code in the
range
.RI [0, n \-1].
.PP
.I Fortune
prints a one-line aphorism chosen at random.
If a
.I file
is specified, the saying is taken from that file;
otherwise it is selected from
.FR /usr/games/lib/fortunes .
.SH FILES
.F /usr/games/lib/fortunes
.br
.F /usr/games/lib/fortunes.index
fast lookup table, maintained automatically
.SH BUGS
Successive results of option
.B -e
are highly correlated if
.I random
is called more than once per second.