When a user logs into a system normally the /etc/motd is displayed. ( You can disable this by creating the file ~/.hushlogin.) You will be greeted by something like ''welcome to 127.0.0.1''. That is boring.
Here comes ''fortune'' to the rescue. The package comes with 3 programs: fortune,strfile and unstr.
The programs have clear distinguished jobs: presentation, assembly and disassembly of the fortune databases.
fortune is the presenter program. A simple application is to call the program in the crontab and modify the /etc/motd. e.g.:
*/10 * * * * /usr/bin/fortune >/etc/motd To select a given database with quotes simply add the database as argument. */10 * * * * /usr/bin/fortune myquotes >/etc/motd
> fortune myquotes startrek
> fortune 90% myquotes 10% startrek
Now we come to terms. Pick a list of quotes. There are several sources. Of cause the Internet will provide you with a long list. Choose quotes you like they will appear regularly now. Collect the quotes in one file. Every quote separated with a line containing a single % e.g.:
quote 1 % quote 2 % quote 3 % quote 5
> strfile myquotes
/usr/share/fortune
. Check the installation with:
>fortune myquotes
This is what the man-page says:
The purpose of unstr is to undo the work of strfile. It prints out the strings contained in the file source_file in the order that they are listed in the header file source_file.dat to standard output. It is possible to create sorted versions of input files by using -o when strfile is run and then using unstr to dump them out in the table order.
An other possible target is .signature
.
Any selfrespecting mailprogram will add that to an outgoing mail.
The patchnames mentioned here are based on the actual fortune package. Distribution may change the place to somewhere.
Beside fortune there are several other programs that select random quotes from a database.
Be carefull when choosing quotes. There are people who take them serious like:
====### legal notice ###====------------------------------------------- Microsoft Network is prohibited from redistributing this work in any form, in whole or in part. License to distribute this post is available to Microsoft for $499. Posting without permission constitutes an agreement to these terms. walter@linux:~/bericht/fortune> fortune myquotes "You have the right to remain silent, but I wouldn't encourage you to do so. Anything you say will be taken down, altered to my satisfaction and used in a court of law to send you down for a good many years!"