---
title: Fortune
date: '2018-06-26'
words: 253
collection: ramblings
---

<h2 class="title">Fortune</h2>
<p class="meta">
    253 words
    published
    on June 26, 2018
    <span class="comments-controls" hidden>
        <button type="button" class="comments-toggle"></button>
        <button type="button" class="comments-open" hidden>Read comments</button>
    </span>
</p>

Nothing quite starts a terminal session like `fortune`. It gives you a nice
little quip to ponder as you settle into your groove. The database is filled
with a bunch of jokes and philosophy that might just make you think
-- how novel. I've been using it in my `config.fish` (akin to `.bashrc`) for
years now.

> The shortest distance between two points is under construction.
>
> -- Noelie Alito

But, `fortune` could be so much better. Mainly, it's the perfect tool for
collecting a personal database of quotes or random thoughts. It's actually
really easy to make your own fortunes. All you really need is a file
structured according to the `strfile` format.

```sh
touch personal
```

The format of this file is simple. Each entry is followed by a `%` on it's own
line. For example:

```
A bear is a lot to bear.
%
I've never met a bare bear.
```

Finally you need to turn your text file into a `.dat` with `strfile` itself.

```sh
strfile personal
```

Now you've got yourself a personal database for use in `fortune`. You can use
it by simply passing the file (or directory) as an argument. Larger databases
may want to be divided across many files -- this is possible.

```sh
fortune personal
```


If you'd like to see some of your own fortunes mixed in with others, the syntax
also supports that.

```sh
fortune 50% personal 25% love 25% wisdom
```

Refer to your installation of `fortune` for what databases you have access to.
These are most commonly found in places like `/usr/share/fortune`.

