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