.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{ . if \nF \{ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "FORTUNE 1" .TH FORTUNE 1 "2001-06-06" "perl v5.20.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" fortune \- print a random, hopefully interesting, adage .SH "SYNOPSIS" .IX Header "SYNOPSIS" fortune [\-adefgilosw] [\-m pattern] [[N%] file/dir/all] .SH "DESCRIPTION" .IX Header "DESCRIPTION" When fortune is run with no arguments it prints out a random epigram. Epigrams are divided into several categories, where each category is sub\- divided into those which are potentially offensive and those which are not. The options are as follows: .PP .Vb 2 \& \-a Choose from all lists of maxims, both offensive and not. (See the \& \-o option for more information on offensive fortunes.) \& \& \-e Consider all fortune files to be of equal size (see discussion be\- \& low on multiple files). \& \& \-f Print out the list of files which would be searched, but do not \& print a fortune. \& \& \-l Long dictums only. Long is defined as 200 or more charaters. \& \& \-m Print out all fortunes which match the regular expression pattern. \& See regex(3) for a description of patterns. \& \& \-o Choose only from potentially offensive aphorisms. Please, please, \& please request a potentially offensive fortune if and only if you \& believe, deep down in your heart, that you are willing to be of\- \& fended. (And that if you are, you\*(Aqll just quit using \-o rather \& than give us grief about it, okay?) \& \& ... let us keep in mind the basic governing philosophy of The \& Brotherhood, as handsomely summarized in these words: we be\- \& lieve in healthy, hearty laughter \-\- at the expense of the \& whole human race, if needs be. Needs be. \& \-\-H. Allen Smith, "Rude Jokes" \& \& \-s Short apothegms only. Short is defined as less than 200 charaters. \& \& \-i Ignore case for \-m patterns. \& \& \-w Wait before termination for an amount of time calculated from the \& number of characters in the message. This is useful if it is exe\- \& cuted as part of the logout procedure to guarantee that the message \& can be read before the screen is cleared. \& \& The user may specify alternate sayings. You can specify a specific file, \& a directory which contains one or more files, or the special word all \& which says to use all the standard databases. Any of these may be pre\- \& ceded by a percentage, which is a number N between 0 and 100 inclusive, \& followed by a %. If it is, there will be a N percent probability that an \& adage will be picked from that file or directory. If the percentages do \& not sum to 100, and there are specifications without percentages, the re\- \& maining percent will apply to those files and/or directories, in which \& case the probability of selecting from one of them will be based on their \& relative sizes. \& \& As an example, given two databases funny and not\-funny, with funny twice \& as big, saying \& \& fortune funny not\-funny \& \& will get you fortunes out of funny two\-thirds of the time. The command \& \& fortune 90% funny 10% not\-funny \& \& will pick out 90% of its fortunes from funny (the \`\`10% not\-funny\*(Aq\*(Aq is \& unnecessary, since 10% is all that\*(Aqs left). The \-e option says to con\- \& sider all files equal; thus \& \& fortune \-e \& \& is equivalent to \& \& fortune 50% funny 50% not\-funny .Ve .SH "FILES" .IX Header "FILES" fortune readme \&./fortunes \&./fortunes/fortunes1 \&./fortunes/fortunes2\-o \&./fortunes/fortunes2 \&./fortunes/limerick \&./fortunes/lwall \&./fortunes/startrek \&./fortunes/zippy .SH "BUGS" .IX Header "BUGS" The matching is only working 50% of the time using single quotes around strings with white space and not at all for double quotes. .PP Command line input of files does not work. .SH "TO DO" .IX Header "TO DO" Get the command line args of files and percentages to work. .SH "REVISION HISTORY" .IX Header "REVISION HISTORY" .Vb 5 \& Revision 1.0.1 1999/06/07 andy murren \& Small fixes and code clean up \& FindBin now helps locate the directory of fortunes \& Will search multiple files for a match \& Dumped the \-g option I tried in the original \& \& Revision 1.0 1999/04/01 andy murren \& Inital Revision .Ve .SH "AUTHOR" .IX Header "AUTHOR" This Perl implmentation of \fIfortune\fR was written by Andy Murren, \fIandy@murren.org\fR. .SH "COPYRIGHT and LICENSE" .IX Header "COPYRIGHT and LICENSE" This program is covered by the \s-1GNU\s0 Public License (\s-1GPL\s0). See \fIhttp://www.gnu.org/copyleft/gpl.html\fR for complete detail of the license.