All rights reserved.
This code is derived from software contributed to Berkeley by
Ken Arnold.
%sccs.include.redist.man%
@(#)fortune.6 6.8 (Berkeley) 06/23/90
-a Choose from all lists of maxims, both offensive and not.
-e Consider all fortune files to be of equal size (see discussion below on multiple files).
-f Print out the list of files which would be searched, but don't print a fortune.
-l Long dictums only.
-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 offended. (And that if you are, you'll 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 believe 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.
-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 executed 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 preceded 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 remaining 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
fortune 90% funny 10% not-funny
fortune -e
fortune 50% funny 50% not-funny