LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   How to Create Fortune Database (https://www.linuxquestions.org/questions/linux-software-2/how-to-create-fortune-database-221315/)

ddpicard 08-23-2004 10:19 AM

How to Create Fortune Database
 
I have been googling around for a while but I can't seem to find my answer. I want to create my own fortune files. By googling I have found a lot of fortune files to add but nothing on how they create them.

I know there are always 2 files. One is a .DAT file and the other is the text. Does anyone know how to create these or where I might find the instructions to creat them?

Thanks,
Dave

ddpicard 08-25-2004 08:48 PM

Well, it's been a couple of days. I still can't find my answer. Anyone else have any ideas?

Dave

ddpicard 08-25-2004 09:05 PM

Ok, once again google comes through for me. This was a touch one to find though. In case someone else is interested here is how you create your own Fortune Database:

create a file with quotes separated by %

%
silly quote 1
%
silly quote 2
%

call it sillyqoutes - and copy it to your fortunes directory (say
/usr/share/games/fortunes/) or wherever your fortunes are

Then run

# strfile sillyquotes

Then all you have to do is run fortune sillyquotes

Works great. Very easy to make.

Hope this helps somebody else,
Dave

mmcnees 09-16-2004 01:48 PM

This was a big help for me. I just googled for it and found your post right off. Thanks for the info!

- Mike

buzzbomb 01-07-2009 01:35 PM

Thanks
 
Thanks. It worked for me too. But I had to specify the path to the sillyquotes file I created.

Buzz

x111 08-03-2010 04:41 AM

Quote:

Originally Posted by buzzbomb (Post 3400209)
Thanks. It worked for me too. But I had to specify the path to the sillyquotes file I created.

Buzz

No you don't have to do so. Just move the files to /usr/share/games/fortune. This is where fortune stores its database files. fortune will randomly select one of those files to pick a quote.


All times are GMT -5. The time now is 07:17 PM.