]> CyberLeo.Net >> Repos - FreeBSD/releng/8.1.git/blob - games/fortune/fortune/fortune.6
Copy stable/8 to releng/8.1 in preparation for 8.1-RC1.
[FreeBSD/releng/8.1.git] / games / fortune / fortune / fortune.6
1 .\" Copyright (c) 1985, 1991, 1993
2 .\"     The Regents of the University of California.  All rights reserved.
3 .\"
4 .\" This code is derived from software contributed to Berkeley by
5 .\" Ken Arnold.
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 .\"     @(#)fortune.6   8.3 (Berkeley) 4/19/94
36 .\" $FreeBSD$
37 .\"
38 .Dd November 7, 2007
39 .Dt FORTUNE 6
40 .Os
41 .Sh NAME
42 .Nm fortune
43 .Nd "print a random, hopefully interesting, adage"
44 .Sh SYNOPSIS
45 .Nm
46 .Op Fl aDefilosw
47 .Op Fl m Ar pattern
48 .Oo
49 .Op Ar \&N%
50 .Ar file Ns / Ns Ar directory Ns / Ns Cm all
51 .Oc
52 .Sh DESCRIPTION
53 When
54 .Nm
55 is run with no arguments it prints out a random epigram.
56 Epigrams are divided into several categories, where each category
57 is subdivided into those which are potentially offensive and those
58 which are not.
59 The options are as follows:
60 .Bl -tag -width indent
61 .It Fl a
62 Choose from all lists of maxims, both offensive and not.
63 (See the
64 .Fl o
65 option for more information on offensive fortunes.)
66 .It Fl D
67 Enable additional debugging output.
68 Specify this option multiple times for more verbose output.
69 Only available if compiled with
70 .Li -DDEBUG .
71 .It Fl e
72 Consider all fortune files to be of equal size (see discussion below
73 on multiple files).
74 .It Fl f
75 Print out the list of files which would be searched, but do not
76 print a fortune.
77 .It Fl l
78 Long dictums only.
79 .It Fl m Ar pattern
80 Print out all fortunes which match the regular expression
81 .Ar pattern .
82 See
83 .Xr regex 3
84 for a description of patterns.
85 .It Fl o
86 Choose only from potentially offensive aphorisms.
87 .Bf -symbolic
88 Please, please, please request a potentially offensive fortune if and
89 only if you believe, deep down in your heart, that you are willing
90 to be offended.
91 (And that if you are not willing, you will just quit using
92 .Fl o
93 rather than give us
94 grief about it, okay?)
95 .Ef
96 .Bd -unfilled -offset indent
97 \&... let us keep in mind the basic governing philosophy
98 of The Brotherhood, as handsomely summarized in these words:
99 we believe in healthy, hearty laughter -- at the expense of
100 the whole human race, if needs be.
101 Needs be.
102                            --H. Allen Smith, "Rude Jokes"
103 .Ed
104 .It Fl s
105 Short apothegms only.
106 .It Fl i
107 Ignore case for
108 .Fl m
109 patterns.
110 .It Fl w
111 Wait before termination for an amount of time calculated from the
112 number of characters in the message.
113 This is useful if it is executed as part of the logout procedure
114 to guarantee that the message can be read before the screen is cleared.
115 .El
116 .Pp
117 The user may specify alternate sayings.
118 You can specify a specific file, a directory which contains one or
119 more files, or the special word
120 .Cm all
121 which says to use all the standard databases.
122 Any of these may be preceded by a percentage, which is a number
123 .Ar N
124 between 0 and 100 inclusive, followed by a
125 .Ql % .
126 If it is, there will be an
127 .Ar N
128 percent probability that an adage will be picked from that file
129 or directory.
130 If the percentages do not sum to 100, and there are specifications
131 without percentages, the remaining percent will apply to those files
132 and/or directories, in which case the probability of selecting from
133 one of them will be based on their relative sizes.
134 .Pp
135 As an example, given two databases
136 .Pa funny
137 and
138 .Pa not-funny ,
139 with
140 .Pa funny
141 twice as big, saying
142 .Pp
143 .Dl "fortune funny not-funny"
144 .Pp
145 will get you fortunes out of
146 .Pa funny
147 two-thirds of the time.
148 The command
149 .Pp
150 .Dl "fortune 90% funny 10% not-funny"
151 .Pp
152 will pick out 90% of its fortunes from
153 .Pa funny
154 (the
155 .Dq Li "10% not-funny"
156 is unnecessary, since 10% is all that is left).
157 The
158 .Fl e
159 option says to consider all files equal;
160 thus
161 .Pp
162 .Dl "fortune -e funny not-funny"
163 .Pp
164 is equivalent to
165 .Pp
166 .Dl "fortune 50% funny 50% not-funny"
167 .Sh ENVIRONMENT
168 .Bl -tag -width ".Ev FORTUNE_PATH"
169 .It Ev FORTUNE_PATH
170 The search path for the data files.
171 It is a colon-separated list of directories in which
172 .Nm
173 looks for data files.
174 If not set it will default to
175 .Pa /usr/games/fortune .
176 If none of the directories specified exist, it will print a warning and exit.
177 .El
178 .Sh FILES
179 .Bl -tag -width ".Pa /usr/share/games/fortune/*"
180 .It Pa /usr/games/fortune
181 .It Pa /usr/share/games/fortune/*
182 the fortunes databases (those files ending
183 .Dq Pa -o
184 contain the
185 .Sy offensive
186 fortunes)
187 .El
188 .Sh SEE ALSO
189 .Xr arc4random_uniform 3 ,
190 .Xr regcomp 3 ,
191 .Xr regex 3 ,
192 .Xr strfile 8