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: src/games/fortune/fortune/fortune.6,v 1.9.2.6 2001/12/14 14:26:32 ru Exp $ 37.\" $DragonFly: src/games/fortune/fortune/fortune.6,v 1.2 2003/06/17 04:25:24 dillon Exp $ 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 aDefilosw 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 D 68Enable additional debugging output. 69Specify this option multiple times for more verbose output. 70Only available if compiled with -DDEBUG. 71.It Fl e 72Consider all fortune files to be of equal size (see discussion below 73on multiple files). 74.It Fl f 75Print out the list of files which would be searched, but don't 76print a fortune. 77.It Fl l 78Long dictums only. 79.It Fl m 80Print out all fortunes which match the regular expression 81.Ar pattern . 82See 83.Xr regex 3 84for a description of patterns. 85.It Fl o 86Choose only from potentially offensive aphorisms. 87.Bf -symbolic 88Please, please, please request a potentially offensive fortune if and 89only if you believe, deep down in your heart, that you are willing 90to be offended. 91(And that if you are not willing, you'll just quit using 92.Fl o 93rather than give us 94grief about it, okay?) 95.Ef 96.Bd -ragged -offset indent 97\&... let us keep in mind the basic governing philosophy 98of The Brotherhood, as handsomely summarized in these words: 99we believe in healthy, hearty laughter -- at the expense of 100the whole human race, if needs be. 101Needs be. 102.Bd -ragged -offset indent-two -compact 103--H. Allen Smith, "Rude Jokes" 104.Ed 105.Ed 106.It Fl s 107Short apothegms only. 108.It Fl i 109Ignore case for 110.Fl m 111patterns. 112.It Fl w 113Wait before termination for an amount of time calculated from the 114number of characters in the message. 115This is useful if it is executed as part of the logout procedure 116to guarantee that the message can be read before the screen is cleared. 117.El 118.Pp 119The user may specify alternate sayings. 120You can specify a specific file, a directory which contains one or 121more files, or the special word 122.Em all 123which says to use all the standard databases. 124Any of these may be preceded by a percentage, which is a number 125.Ar N 126between 0 and 100 inclusive, followed by a 127.Ar % . 128If it is, there will be a 129.Ar N 130percent probability that an adage will be picked from that file 131or directory. 132If the percentages do not sum to 100, and there are specifications 133without percentages, the remaining percent will apply to those files 134and/or directories, in which case the probability of selecting from 135one of them will be based on their relative sizes. 136.Pp 137As an example, given two databases 138.Em funny 139and 140.Em not-funny , 141with 142.Em funny 143twice as big, saying 144.Bd -literal -offset indent 145fortune funny not-funny 146.Ed 147.Pp 148will get you fortunes out of 149.Em funny 150two-thirds of the time. 151The command 152.Bd -literal -offset indent 153fortune 90% funny 10% not-funny 154.Ed 155.Pp 156will pick out 90% of its fortunes from 157.Em funny 158(the 159.Dq 10% not-funny 160is unnecessary, since 10% is all that's left). 161The 162.Fl e 163option says to consider all files equal; 164thus 165.Bd -literal -offset indent 166fortune -e funny not-funny 167.Ed 168.Pp 169is equivalent to 170.Bd -literal -offset indent 171fortune 50% funny 50% not-funny 172.Ed 173.Sh FILES 174.Bl -tag -width Pa -compact 175.It Pa /usr/games/fortune 176.Pp 177.It Pa /usr/share/games/fortune/* 178the fortunes databases (those files ending 179.Dq -o 180contain the 181.Bf -symbolic 182offensive 183.Ef 184fortunes) 185.El 186.Sh SEE ALSO 187.Xr regcomp 3 , 188.Xr regex 3 , 189.Xr strfile 8 190