Fortune is a unix utility
- Download the plain-text of your favorite book :
- Name the file what you want the fortune command to invoke
- eg alice
- Change line endings from DOS to unix :
:set ff=unixin vim
- Delete the preamble and license at the end
- (while respecting it)
- Delete all the chapter titles
:g/CHAPTER*/din vim
- Fix newline discrepancy
:%s/\n\n\n/\r\r/gwith increasing number of\ns until nothing matches (let me know if there's a better way)
- Add % signs to separate paragraphs
:%s/\n\n/\r\r%\r\r/g- This could also be used to add author names/ book titles to each quote
- Randomize access to the file using strfile
strfile alicethis should give you alice.dat
- Copy the fortunes to the right spot!
cp alice* /usr/share/games/fortuneon FreeBSD
- Enjoy!
$fortune alice