Skip to content

A shell script to print random quotations, fortunes, etc. from a specified path

License

Notifications You must be signed in to change notification settings

bdellaterra/loot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Loot

I wrote loot as a replacement for the fortune command, to avoid needing to run manual commands with root access to update my quotation files. This script relies on some GNU coreutils such as shuf. You may find it useful for printing other random text besides quotations, just bear in mind it has not been heavily tested.

Usage

usage: loot [options] [target file or directory]

Print random quotes or text from within the target file/directory specified. By default entries are delimited by a line containing only the '%' character. The last entry must be terminated by the delimiter as well.

Example:

quotes.txt

"One original thought is worth a thousand mindless quotings."
 -- Diogenes
%
"To be is to do - Socrates

 To do is to be - Sartre

 Do Be Do Be Do - Sinatra"
 -- Kurt Vonnegut
%
"You'll find your fortune fallin' all over town
 Be sure that your umbrella is up-up-up-up-up-upside down"
 -- Louis Prima
%

Options

--help,-h                Show this help text
--number,-n              Number of random entries to print (Default 1)
--input-delimiter,-i     Delimiter separating entries within the text file(s) (Default '%')
--output-delimiter,-o    Delimiter separating printed entries (Default '' for a blank line)
--glob,-g                Glob pattern for matching files within a target directory (All files by default)
--width,-w               Number of columns until output is forced to line-wrap (Default 80)

About

A shell script to print random quotations, fortunes, etc. from a specified path

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages