Kind of like fortune, but much simpler and focused on THHGTTG.
Find a file
2023-03-18 23:37:48 -04:00
data Initial commit 2023-03-18 23:37:48 -04:00
man Initial commit 2023-03-18 23:37:48 -04:00
src Initial commit 2023-03-18 23:37:48 -04:00
.gitignore Initial commit 2023-03-18 23:37:48 -04:00
Cargo.lock Initial commit 2023-03-18 23:37:48 -04:00
Cargo.toml Initial commit 2023-03-18 23:37:48 -04:00
LICENSE Initial commit 2023-03-18 23:37:48 -04:00
Makefile Initial commit 2023-03-18 23:37:48 -04:00
README.md Initial commit 2023-03-18 23:37:48 -04:00

Description

42 is a silly little utility similar in nature to the Unix fortune command of old, if it was much simpler and only provided Douglas Adams quotes primarily from the HitchHiker's guide.

History

The original 42 was written in C for HitchHiker Linux back when I was first learning how to program in that language. This rewrite in Rust preserves much of the simplicity of the original while being more robust and providing more flexibility in where it's data files are stored.

Installation

To build 42 you will need a Rust toolchain. The only explicit dependency besides std is the rand crate, and the code is simple without much reliance on bleeding edge features, so there should be some flexibility in what version of Rust is used. The included Makefile wraps the commands used and will install the data files and Unix man pages into the proper locations. Should you wish to package this little gem for your own distro (I'm not sure why, but maybe you would?) then all of the files can be installed into a destdir by passing the DESTDIR environment variable to make install.

make && make install

Usage

Most commonly you would call this program from your shell startup files by adding 42 & to ~/.bashrc or ~/.zshrc, or whatever file your shell happens to use. This will give you a DA quote every time you log in or open a new terminal window.