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