FORTUNE(6) | Games Manual | FORTUNE(6) |
fortune | [-aefilosw] [-m pattern] [[N%] file/dir/all] |
The user may specify alternative 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 ‘%' character. If it is, there will be an 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
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%” is unnecessary, since 10% is all that's left). The -e option says to consider all files equal; thus
$ fortune -e
is equivalent to
$ fortune 50% funny 50% not-funny
Datafiles for fortune are created by the strfile(8) utility, which is not installed by default, The source code for this utility can be found in /usr/src/games/fortune/strfile, if it exists.
September 9, 2004 | NetBSD 6.1 |