Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ fortune(6) — DYNIX/ptx 3.2.0

Media Vault

Software Library

Restoration Projects

Artifacts Sought

FORTUNE(6)  —  UNIX Programmer’s Manual

NAME

fortune − print a random, hopefully interesting, adage

SYNOPSIS

/usr/games/fortune [ − ] [ −wslao ]

DESCRIPTION

Fortune with no arguments prints out a random adage. The flags mean:

−w Waits 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. 

−s Short messages only. 

−l Long messages only. 

−o Choose from an alternate list of adages, often used for potentially offensive ones. 

−a Choose from either list of adages. 

MESSAGE FILE

Fortune gets messages from the file /usr/games/lib/fortunes.dat.  This file contains only example messages.  To create your own fortunes.dat file, do the following:

(1)Create a file of messages in /usr/games/lib that follows this general format:

 fortune message #1
%%
fortune message #2
%%
fortune message #3
 

If you choose to support the −o option of fortune, create a separate message file with the same format but containing the alternate messages. 

(2)In /usr/games/lib execute the following commands to create a new fortunes.dat message file:

 % cat file1 > fortunes
% echo "%-" >> fortunes
% cat file2 >> fortunes
% echo "%%" >> fortunes
 

where file1 is the file of general fortune messages and file2 is the optional file of alternate messages.  If you do not wish to include alternate messages in fortunes.dat, simply skip the command:

 % cat file2 >> fortunes
 

when creating the message file. 

(3)Either rename the existing fortunes.dat to another name or remove it completely.  Finally, execute the following commands in /usr/games/lib:

 % ./strfile fortunes
% chown daemon fortunes.dat
% chmod 0600 fortunes.dat
 

FILES

/usr/games/lib/fortunes.dat - messages data file
/usr/games/lib/strfile - tool to build messages data file

AUTHOR

Ken Arnold

4BSD

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026