BSD 4_4_Lite1 release
[unix-history] / usr / src / games / fortune / fortune / fortune.6
CommitLineData
b4b4c129
KB
1.\" Copyright (c) 1985, 1991, 1993
2.\" The Regents of the University of California. All rights reserved.
be24db95 3.\"
38562346
KB
4.\" This code is derived from software contributed to Berkeley by
5.\" Ken Arnold.
6.\"
ad787160
C
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.
94c01391 22.\"
ad787160
C
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.
be24db95 34.\"
ed554bc5 35.\" @(#)fortune.6 8.3 (Berkeley) 4/19/94
ad787160 36.\"
ed554bc5 37.Dd April 19, 1994
d77d25ce
CL
38.Dt FORTUNE 6
39.Os BSD 4
40.Sh NAME
41.Nm fortune
42.Nd "print a random, hopefully interesting, adage"
43.Sh SYNOPSIS
44.Nm fortune
45.Op Fl aefilosw
46.Op Fl m Ar pattern
47.Oo
48.Op Ar \&N%
49.Ar file/dir/all
50.Oc
51.Sh DESCRIPTION
340543d7 52When
d77d25ce 53.Nm fortune
38562346 54is run with no arguments it prints out a random epigram.
fbfe53a8
KB
55Epigrams are divided into several categories, where each category
56is subdivided into those which are potentially offensive and those
57which are not.
38562346 58The options are as follows:
d77d25ce
CL
59.Bl -tag -width flag
60.It Fl a
fbfe53a8 61Choose from all lists of maxims, both offensive and not.
c53bde95
KB
62(See the
63.Fl o
64option for more information on offensive fortunes.)
d77d25ce 65.It Fl e
38562346
KB
66Consider all fortune files to be of equal size (see discussion below
67on multiple files).
d77d25ce 68.It Fl f
38562346
KB
69Print out the list of files which would be searched, but don't
70print a fortune.
d77d25ce 71.It Fl l
38562346 72Long dictums only.
d77d25ce 73.It Fl m
340543d7 74Print out all fortunes which match the regular expression
d77d25ce 75.Ar pattern .
340543d7 76See
d77d25ce 77.Xr regex 3
38562346 78for a description of patterns.
d77d25ce 79.It Fl o
fbfe53a8 80Choose only from potentially offensive aphorisms.
d77d25ce 81.Bf -symbolic
fbfe53a8
KB
82Please, please, please request a potentially offensive fortune if and
83only if you believe, deep down in your heart, that you are willing
388d6e7f 84to be offended.
d77d25ce
CL
85(And that if you are, you'll just quit using
86.Fl o
87rather than give us
fbfe53a8 88grief about it, okay?)
d77d25ce
CL
89.Ef
90.Bd -filled -offset indent
388d6e7f
KB
91\&... let us keep in mind the basic governing philosophy
92of The Brotherhood, as handsomely summarized in these words:
93we believe in healthy, hearty laughter -- at the expense of
94the whole human race, if needs be.
95Needs be.
d77d25ce
CL
96.Bd -filled -offset indent-two -compact
97--H. Allen Smith, "Rude Jokes"
98.Ed
99.Ed
100.It Fl s
38562346 101Short apothegms only.
d77d25ce 102.It Fl i
340543d7 103Ignore case for
d77d25ce 104.Fl m
340543d7 105patterns.
d77d25ce 106.It Fl w
38562346
KB
107Wait before termination for an amount of time calculated from the
108number of characters in the message.
109This is useful if it is executed as part of the logout procedure
110to guarantee that the message can be read before the screen is cleared.
d77d25ce
CL
111.El
112.Pp
340543d7 113The user may specify alternate sayings.
38562346
KB
114You can specify a specific file, a directory which contains one or
115more files, or the special word
d77d25ce 116.Em all
340543d7 117which says to use all the standard databases.
38562346 118Any of these may be preceded by a percentage, which is a number
d77d25ce 119.Ar N
38562346 120between 0 and 100 inclusive, followed by a
d77d25ce 121.Ar % .
38562346 122If it is, there will be a
d77d25ce 123.Ar N
38562346
KB
124percent probability that an adage will be picked from that file
125or directory.
126If the percentages do not sum to 100, and there are specifications
127without percentages, the remaining percent will apply to those files
128and/or directories, in which case the probability of selecting from
129one of them will be based on their relative sizes.
d77d25ce 130.Pp
38562346 131As an example, given two databases
d77d25ce 132.Em funny
340543d7 133and
d77d25ce 134.Em not-funny ,
340543d7 135with
d77d25ce 136.Em funny
38562346 137twice as big, saying
d77d25ce 138.Bd -literal -offset indent
340543d7 139fortune funny not-funny
d77d25ce
CL
140.Ed
141.Pp
340543d7 142will get you fortunes out of
d77d25ce 143.Em funny
340543d7
KB
144two-thirds of the time.
145The command
d77d25ce 146.Bd -literal -offset indent
340543d7 147fortune 90% funny 10% not-funny
d77d25ce
CL
148.Ed
149.Pp
340543d7 150will pick out 90% of its fortunes from
d77d25ce 151.Em funny
fbfe53a8 152(the ``10% not-funny'' is unnecessary, since 10% is all that's left).
340543d7 153The
d77d25ce 154.Fl e
340543d7
KB
155option says to consider all files equal;
156thus
d77d25ce
CL
157.Bd -literal -offset indent
158fortune -e
159.Ed
160.Pp
340543d7 161is equivalent to
d77d25ce 162.Bd -literal -offset indent
107786a6
KB
163fortune 50% funny 50% not
164.Em -funny
d77d25ce
CL
165.Ed
166.Sh FILES
167.Bl -tag -width Pa -compact
168.It Pa /usr/share/games/fortune
169.El
d77d25ce
CL
170.Sh SEE ALSO
171.Xr regex 3 ,
172.Xr regcmp 3 ,