fortune

From Gentoo Wiki
Jump to:navigation Jump to:search
This article is a stub. Please help out by expanding it - how to get started.

fortune is a command-line utility which displays a random quotation from a collection of quotes.

Installation

USE flags

USE flags for games-misc/fortune-mod The notorious fortune program

offensive Enable potentially offensive items in packages
pcre Add support for Perl Compatible Regular Expressions
test Enable dependencies and/or preparations necessary to run tests (usually controlled by FEATURES=test but can be toggled independently)

Emerge

root #emerge --ask games-misc/fortune-mod

Usage

Invocation

user $fortune -h
fortune-mod version 3.18.0
fortune [-afilsw] [-m pattern] [-n number] [ [#%] file/directory/all

Configuration

The fortune quote database is stored in separate files for different categories of quotes in the /usr/share/fortune directory. To add fortunes to the database, edit any of the text files in the directory, with a % before and after the quote, as an example,

FILE /usr/share/fortune/fortunes
%
Larry the Cow beckons you to explore the Gentoo Wiki!
%

Cowsay

Fortune supports the cowsay package.

First, emerge cowsay:

root #emerge --ask games-misc/cowsay

Then, use the following command to have cowsay write a fortune.

user $fortune | cowsay
 _________________________________________ 
/ Bounders get bound when they are caught \
| bounding.                               |
|                                         |
\ -- Ralph Lewin                          /
 ----------------------------------------- 
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||