Original author(s) | Ken Arnold |
---|---|
Initial release | 1979; 41 years ago |
Repository | |
Operating system | Unix, Unix-like, Plan 9, Inferno |
Type | Command |
fortune
is a program that displays a pseudorandom message from a database of quotations that first appeared in Version 7 Unix.[1][irrelevant citation] The most common version on modern systems is the BSDfortune
, originally written by Ken Arnold.[2] Distributions of fortune are usually bundled with a collection of themed files, containing sayings like those found on fortune cookies (hence the name), quotations from famous people, jokes, or poetry. As of November 2017, the quotations (with the exception of tips relevant to system operation) have been removed from FreeBSD entirely after user complaints regarding quotations from Adolf Hitler being contained in some of the files.[3]
fortune
is predominantly found on Unix-like systems, but clients for other platforms also exist.[4] Often, users on text-mode Unix terminals will place this command into either their .profile
or .logout
files to display them at logon and logout, respectively. It is also used to generate text input for certain XScreenSaver modes. Many people choose to pipe fortune into the cowsay command, to add more humor to the dialog.
Fortune 1.4 for Mac is free to download from our software library. The most popular versions among the application users are 9.0 and 1.0. Our built-in antivirus checked this Mac download and rated it as 100% safe. The bundle identifier for Fortune for Mac is com.rixstep.Fortune. This free Mac application was originally designed by Macromedia. JavaScript is disabled. You can manually download the latest stable version here.
Content[edit]
Most Unix systems use fortunes which are slanted heavily toward the user base of Unix, and thus contain many obscure jokes about computer science and computer programming. Other favoured sources include quotations from science fiction (Star Trek, The Cyberiad, Doctor Who, The Hitchhiker's Guide to the Galaxy, etc.), Zippy the Pinhead, and the writings of Ambrose Bierce and Dave Barry.[5] Most fortune collections also include a wide variety of more conventionally sourced quotations, jokes, and other short passages. A few distributions include 'offensive' dicta, which require the -a
or -o
options to be passed for viewing. These fortunes often include rude humor and profanity, personal attacks, and controversial comments about religion. Sometimes they are provided by another package, however as of FreeBSD 10.0 the offensive dicta have been removed completely.[6] The exact fortunes vary between each type of Unix, however there seems to be a strong overlap between the FreeBSD and OpenBSD fortune files. The Plan 9 fortune files seem to be much shorter, with many just on 1 line, and the 'offensive' dicta is much stronger. Most Linux distributions, such as Debian (and its derivatives), choose the FreeBSD fortunes to put in their fortune packages, that can be installed through the package manager.
Purpose[edit]
One of the included fortunes, from the 'goedel' collection of fortunes about fortune
itself, sums up the purpose of the program:
The original fortune
program could be used for the more general task of picking up a random line from a plain-text file. The example of such use is given in the rc documentation. However, in most modern Unix systems fortune
cannot be used this way, since they use an ad hoc file format for fortune files to allow multiline aphorisms.
Fortune files[edit]
Conventional versions of fortune
use two files for each quotation list: a text file with quotations, each separated by the character '%' on its own line, and a random-access data file generated by the strfile
(1) program. Alternative implementations, including those made for display on Web pages, typically use only the text file.
Common options[edit]
Fortune Machiavelli
Several common options exist that change the way command-line versions of fortune behave:
Option | Action |
---|---|
-a | Choose from all databases, regardless of whether they are considered 'offensive' or not |
-e | Make the probability of choosing a fortune file equal to that of all other files |
-f | Print out a list of all fortune files that would have been searched, but do not print a fortune |
-i | When used with -m , make regular expression searching case-insensitive |
-l | Use only quotations longer than the length specified with -n , or 160 characters if -n is not used |
-m [pattern] | Print all fortunes matching the regular expression specified in [pattern] |
-n [length] | Override the length used by -l and -s to determine 'long' and 'short' messages (default 160 characters) |
-o | Choose only from 'offensive' databases |
-s | Use only quotations shorter than the length specified with -n , or 160 characters if -n is not used |
-w | Wait for a period of time before terminating; useful for situations in which a fortune needs to be read before the screen is cleared |
See also[edit]
Founders Fortune For Mac
References[edit]
- ^'fortune -- Display Random Quotations'. Clapper.org. Retrieved February 17, 2014.
- ^'[base] Contents of /head/usr.bin/fortune/fortune/fortune.c'. svnweb.freebsd.org. Retrieved 2018-09-15.
This code is derived from software contributed to Berkeley by Ken Arnold.
- ^'[base] Revision 325828'. svnweb.freebsd.org. 2017-11-14. Retrieved 2018-04-14.
- ^An archive of fortunes files from various systems
- ^'Debian Sources: fortune 1:1.99.1-7, 'datfiles' folder'. sources.debian.org. Retrieved 2018-09-15.
- ^'Fortune - removal log'. FreeBSD SVN. FreeBSD. 2013-03-12. Retrieved 2014-06-14.
External links[edit]
fortune(1)
– Plan 9 Programmer's Manual, Volume 1fortune(6)
– Linux Games Manual- The manual page for the original Unix fortune(6) command.
- Maintenance version of fortune-mod's source code - on GitHub with new releases
- ftp://ftp.ibiblio.org/pub/linux/games/amusements/fortune/ – source code for fortune-mod program