fortune.6.in 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. .\" $NetBSD: fortune.6,v 1.11 2004/09/09 22:01:08 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. Neither the name of the University nor the names of its contributors
  18. .\" may be used to endorse or promote products derived from this software
  19. .\" without specific prior written permission.
  20. .\"
  21. .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  22. .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  23. .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  24. .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  25. .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  26. .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  27. .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  28. .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  29. .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  30. .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  31. .\" SUCH DAMAGE.
  32. .\"
  33. .\" @(#)fortune.6 8.3 (Berkeley) 4/19/94
  34. .\"
  35. .Dd September 9, 2004
  36. .Dt FORTUNE 6
  37. .Os
  38. .Sh NAME
  39. .Nm fortune
  40. .Nd print a random, hopefully interesting, adage
  41. .Sh SYNOPSIS
  42. .Nm
  43. .Op Fl aefilosw
  44. .Op Fl m Ar pattern
  45. .Oo
  46. .Op Ar N%
  47. .Ar file/dir/all
  48. .Oc
  49. .Sh DESCRIPTION
  50. When
  51. .Nm
  52. is run with no arguments it prints out a random epigram.
  53. Epigrams are divided into several categories, where each category
  54. is subdivided into those which are potentially offensive and those
  55. which are not.
  56. The options are as follows:
  57. .Bl -tag -width flag
  58. .It Fl a
  59. Choose from all lists of maxims, both offensive and not.
  60. (See the
  61. .Fl o
  62. option for more information on offensive fortunes.)
  63. .It Fl e
  64. Consider all fortune files to be of equal size (see discussion below
  65. on multiple files).
  66. .It Fl f
  67. Print out the list of files which would be searched, but don't
  68. print a fortune.
  69. .It Fl i
  70. Ignore case for
  71. .Fl m
  72. patterns.
  73. .It Fl l
  74. Long dictums only.
  75. .It Fl m Ar pattern
  76. Print out all fortunes which match the regular expression
  77. .Ar pattern .
  78. See
  79. .Xr regex 3
  80. for a description of patterns.
  81. .It Fl o
  82. Choose only from potentially offensive aphorisms.
  83. .Bf -symbolic
  84. Please, please, please request a potentially offensive fortune if and
  85. only if you believe, deep down in your heart, that you are willing
  86. to be offended.
  87. (And that if you are, you'll just quit using
  88. .Fl o
  89. rather than give us grief about it, okay?)
  90. .Ef
  91. .Bd -filled -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.
  96. Needs be.
  97. .Bd -filled -offset indent-two -compact
  98. --H. Allen Smith, "Rude Jokes"
  99. .Ed
  100. .Ed
  101. .It Fl s
  102. Short apothegms only.
  103. .It Fl w
  104. Wait before termination for an amount of time calculated from the
  105. number of characters in the message.
  106. This is useful if it is executed as part of the logout procedure
  107. to guarantee that the message can be read before the screen is cleared.
  108. .El
  109. .Pp
  110. The user may specify alternative sayings.
  111. You can specify a specific file, a directory which contains one or
  112. more files, or the special word
  113. .Em all ,
  114. which says to use all the standard databases.
  115. Any of these may be preceded by a percentage, which is a number
  116. .Ar N
  117. between 0 and 100 inclusive, followed by a
  118. .Sq %
  119. character.
  120. If it is, there will be an
  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%
  152. is unnecessary, since 10% is all that's left).
  153. The
  154. .Fl e
  155. option says to consider all files equal; thus
  156. .Bd -literal -offset indent
  157. $ fortune -e
  158. .Ed
  159. .Pp
  160. is equivalent to
  161. .Bd -literal -offset indent
  162. $ fortune 50% funny 50% not-funny
  163. .Ed
  164. .Pp
  165. Datafiles for
  166. .Nm
  167. are created by the
  168. .Xr strfile 8
  169. utility, which is not installed by default,
  170. The source code for this utility
  171. can on BSD systems be found in
  172. .Pa /usr/src/games/fortune/strfile ,
  173. if it exists.
  174. .Sh FILES
  175. .Bl -tag -width XX@fortune_dir@/*XX -compact
  176. .It Pa @fortune_dir@/*
  177. Fortune files.
  178. .El
  179. .Sh SEE ALSO
  180. .Xr regex 3 ,
  181. .Xr random 6 ,
  182. .Xr rot13 6