Merge branch 'vendor/TCPDUMP'
[dragonfly.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. Neither the name of the University nor the names of its contributors
16 .\"    may be used to endorse or promote products derived from this software
17 .\"    without specific prior written permission.
18 .\"
19 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
20 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
23 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29 .\" SUCH DAMAGE.
30 .\"
31 .\"     @(#)fortune.6   8.3 (Berkeley) 4/19/94
32 .\" $FreeBSD: src/games/fortune/fortune/fortune.6,v 1.9.2.6 2001/12/14 14:26:32 ru Exp $
33 .\" $DragonFly: src/games/fortune/fortune/fortune.6,v 1.2 2003/06/17 04:25:24 dillon Exp $
34 .\"
35 .Dd April 19, 1994
36 .Dt FORTUNE 6
37 .Os
38 .Sh NAME
39 .Nm fortune
40 .Nd "print a random, hopefully interesting, adage"
41 .Sh SYNOPSIS
42 .Nm
43 .Op Fl aDefilosw
44 .Op Fl m Ar pattern
45 .Oo
46 .Op Ar \&N%
47 .Ar file/dir/all
48 .Oc
49 .Sh DESCRIPTION
50 When
51 .Nm
52 is run with no arguments it prints out a random epigram.
53 Epigrams are divided into several categories, where each category
54 is subdivided into those which are potentially offensive and those
55 which are not.
56 The options are as follows:
57 .Bl -tag -width flag
58 .It Fl a
59 Choose from all lists of maxims, both offensive and not.
60 (See the
61 .Fl o
62 option for more information on offensive fortunes.)
63 .It Fl D
64 Enable additional debugging output.
65 Specify this option multiple times for more verbose output.
66 Only available if compiled with -DDEBUG.
67 .It Fl e
68 Consider all fortune files to be of equal size (see discussion below
69 on multiple files).
70 .It Fl f
71 Print out the list of files which would be searched, but don't
72 print a fortune.
73 .It Fl l
74 Long dictums only.
75 .It Fl m
76 Print out all fortunes which match the regular expression
77 .Ar pattern .
78 See
79 .Xr regex 3
80 for a description of patterns.
81 .It Fl o
82 Choose only from potentially offensive aphorisms.
83 .Bf -symbolic
84 Please, please, please request a potentially offensive fortune if and
85 only if you believe, deep down in your heart, that you are willing
86 to be offended.
87 (And that if you are not willing, you'll just quit using
88 .Fl o
89 rather than give us
90 grief about it, okay?)
91 .Ef
92 .Bd -ragged -offset indent
93 \&... let us keep in mind the basic governing philosophy
94 of The Brotherhood, as handsomely summarized in these words:
95 we believe in healthy, hearty laughter -- at the expense of
96 the whole human race, if needs be.
97 Needs be.
98 .Bd -ragged -offset indent-two -compact
99 --H. Allen Smith, "Rude Jokes"
100 .Ed
101 .Ed
102 .It Fl s
103 Short apothegms only.
104 .It Fl i
105 Ignore case for
106 .Fl m
107 patterns.
108 .It Fl w
109 Wait before termination for an amount of time calculated from the
110 number of characters in the message.
111 This is useful if it is executed as part of the logout procedure
112 to guarantee that the message can be read before the screen is cleared.
113 .El
114 .Pp
115 The user may specify alternate sayings.
116 You can specify a specific file, a directory which contains one or
117 more files, or the special word
118 .Em all
119 which says to use all the standard databases.
120 Any of these may be preceded by a percentage, which is a number
121 .Ar N
122 between 0 and 100 inclusive, followed by a
123 .Ar % .
124 If it is, there will be a
125 .Ar N
126 percent probability that an adage will be picked from that file
127 or directory.
128 If the percentages do not sum to 100, and there are specifications
129 without percentages, the remaining percent will apply to those files
130 and/or directories, in which case the probability of selecting from
131 one of them will be based on their relative sizes.
132 .Pp
133 As an example, given two databases
134 .Em funny
135 and
136 .Em not-funny ,
137 with
138 .Em funny
139 twice as big, saying
140 .Bd -literal -offset indent
141 fortune funny not-funny
142 .Ed
143 .Pp
144 will get you fortunes out of
145 .Em funny
146 two-thirds of the time.
147 The command
148 .Bd -literal -offset indent
149 fortune 90% funny 10% not-funny
150 .Ed
151 .Pp
152 will pick out 90% of its fortunes from
153 .Em funny
154 (the
155 .Dq 10% not-funny
156 is unnecessary, since 10% is all that's left).
157 The
158 .Fl e
159 option says to consider all files equal;
160 thus
161 .Bd -literal -offset indent
162 fortune -e funny not-funny
163 .Ed
164 .Pp
165 is equivalent to
166 .Bd -literal -offset indent
167 fortune 50% funny 50% not-funny
168 .Ed
169 .Sh FILES
170 .Bl -tag -width Pa -compact
171 .It Pa /usr/games/fortune
172 .Pp
173 .It Pa /usr/share/games/fortune/*
174 the fortunes databases (those files ending
175 .Dq -o
176 contain the
177 .Bf -symbolic
178 offensive
179 .Ef
180 fortunes)
181 .El
182 .Sh SEE ALSO
183 .Xr regcomp 3 ,
184 .Xr regex 3 ,
185 .Xr strfile 8