]> granicus.if.org Git - fortune-mod/blob - fortune-mod/fortune/fortune-man.part1
Add the files as of fortune-mod-1.99.1.
[fortune-mod] / fortune-mod / fortune / fortune-man.part1
1 .\"     $NetBSD: fortune.6,v 1.4 1995/03/23 08:28:37 cgd 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 .\" This version of the man page has been modified heavily, like the
40 .\" program it documents.  Some of the changes may be exclusive to
41 .\" Linux.  Amy A. Lewis, September, 1995.
42 .\"
43 .\" Changes Copyright (c) 1997 Dennis L. Clark.  All rights reserved.
44 .\"
45 .\"   The changes in this file may be freely redistributed, modified or
46 .\"   included in other software, as long as both the above copyright
47 .\"   notice and these conditions appear intact.
48 .\"
49 .TH FORTUNE 6 "19 April 94 [May. 97]" "BSD Experimental" "UNIX Reference Manual"
50 .SH NAME
51 fortune \- print a random, hopefully interesting, adage
52 .SH SYNOPSIS
53 .BR fortune " [" -acefilosw "] [" -n 
54 .IR length "] ["
55 .B -m 
56 .IR pattern "] [[" n% "] " file/dir/all ]
57 .SH DESCRIPTION
58 When
59 .B fortune
60 is run with no arguments it prints out a random epigram. Epigrams are
61 divided into several categories, where each category is sub-divided
62 into those which are potentially offensive and those which are not.
63 .SS Options
64 The options are as follows:
65 .TP
66 .B -a
67 Choose from all lists of maxims, both offensive and not.  (See the
68 .B -o 
69 option for more information on offensive fortunes.)
70 .TP
71 .B -c
72 Show the cookie file from which the fortune came.
73 .TP
74 .B -e
75 Consider all fortune files to be of equal size (see discussion below
76 on multiple files).
77 .TP
78 .B -f
79 Print out the list of files which would be searched, but don't
80 print a fortune.
81 .TP
82 .B -l
83 Long dictums only.  See 
84 .B -n
85 on how ``long'' is defined in this sense.
86 .TP
87 .BI "-m " pattern
88 Print out all fortunes which match the basic regular expression
89 .IR pattern .
90 The syntax of these expressions depends on how your system defines
91 .BR re_comp "(3) or " regcomp (3),
92 but it should nevertheless be similar to the syntax used in
93 .BR grep (1).
94 .sp
95 .RS
96 The fortunes are output to standard output, while the names of the file
97 from which each fortune comes are printed to standard error.  Either or
98 both can be redirected; if standard output is redirected to a file, the
99 result is a valid fortunes database file.  If standard error is 
100 .I also
101 redirected to this file, the result is 
102 .IR "still valid" ,
103 .B but there will be ``bogus''
104 .BR fortunes , 
105 i.e. the filenames themselves, in parentheses.  This can be useful if you
106 wish to remove the gathered matches from their original files, since each
107 filename-record will precede the records from the file it names.
108 .RE
109 .TP
110 .BI "-n " length
111 Set the longest fortune length (in characters) considered to be
112 ``short'' (the default is 160).  All fortunes longer than this are
113 considered ``long''.  Be careful!  If you set the length too short and
114 ask for short fortunes, or too long and ask for long ones, fortune goes
115 into a never-ending thrash loop.
116 .TP
117 .B -o
118 Choose only from potentially offensive aphorisms.  The -o option is
119 ignored if a fortune directory is specified.
120 .sp
121 .B Please, please, please request a potentially
122 .B offensive fortune if and only if
123 .B you believe, deep in your heart,
124 .B that you are willing to be
125 .B offended. (And that you'll just quit
126 .BR using " -o " rather
127 .B than give us grief about it,
128 .B okay?)
129 .sp
130 .RS
131 \&... let us keep in mind the basic governing philosophy of The
132 Brotherhood, as handsomely summarized in these words: we believe in
133 healthy, hearty laughter -- at the expense of the whole human race, if
134 needs be.  Needs be.
135 .RS
136 --H. Allen Smith, "Rude Jokes"
137 .RE
138 .RE
139 .TP
140 .B -s
141 Short apothegms only.  See
142 .B -n
143 on which fortunes are considered ``short''.
144 .TP
145 .B -i
146 Ignore case for 
147 .IR -m
148 patterns.
149 .TP
150 .B -w
151 Wait before termination for an amount of time calculated from the
152 number of characters in the message.  This is useful if it is executed
153 as part of the logout procedure to guarantee that the message can be
154 read before the screen is cleared.
155 .PP
156 The user may specify alternate sayings.  You can specify a specific
157 file, a directory which contains one or more files, or the special word 
158 .I all
159 which says to use all the standard databases.  Any of these may be
160 preceded by a percentage, which is a number 
161 .I n
162 between 0 and 100 inclusive, followed by a 
163 .IR % .
164 If it is, there will be a 
165 .I n
166 percent probability that an adage will be picked from that file or
167 directory. If the percentages do not sum to 100, and there are
168 specifications without percentages, the remaining percent will apply
169 to those files and/or directories, in which case the probability of
170 selecting from one of them will be based on their relative sizes.
171 .PP
172 As an example, given two databases 
173 .IR funny " and " not-funny ", with " funny
174 twice as big (in number of fortunes, not raw file size), saying
175 .RS
176 .sp
177 .B fortune
178 .I funny not-funny
179 .sp
180 .RE
181 will get you fortunes out of 
182 .I funny
183 two-thirds of the time.  The command
184 .RS
185 .sp
186 .B fortune
187 .RI "90% " funny " 10% " not-funny
188 .sp
189 .RE
190 will pick out 90% of its fortunes from 
191 .I funny
192 (the ``10% not-funny'' is unnecessary, since 10% is all that's left).
193 .PP
194 The 
195 .B -e
196 option says to consider all files equal; thus
197 .RS
198 .sp
199 .B fortune -e
200 .I funny not-funny
201 .sp
202 .RE
203 is equivalent to
204 .RS
205 .sp
206 .B fortune
207 .RI "50% " funny " 50% " not-funny
208 .sp
209 .RE
210 This fortune also supports the BSD method of appending ``-o'' to
211 database names to specify offensive fortunes.  However this is
212 .B not
213 how fortune stores them: offensive fortunes are stored in a seperate
214 directory without the ``-o'' infix.  A plain name (i.e., not a path to a
215 file or directory) that ends in ``-o'' will be assumed to be an
216 offensive database, and will have its suffix stripped off and be
217 searched in the offensive directory (even if the neither of the
218 .IR -a " or " -o
219 options were specified).  This feature is not only for
220 backwards-compatibility, but also to allow users to distinguish between
221 inoffensive and offensive databases of the same name.
222 .PP
223 For example, assuming there is a database named
224 .I definitions
225 in both the inoffensive and potentially offensive collections, then the
226 following command will select an inoffensive definition 90% of the time,
227 and a potentially offensive definition for the remaining 10%:
228 .RS
229 .sp
230 .B fortune
231 90%
232 .I definitions definitions-o
233 .RE
234 .SH FILES
235 Note: these are the defaults as defined at compile time.
236 .PP
237 .PD 0
238 .TP