blog

my blog
Log | Files | Refs | Feed

2019-04-14-YtU.md (597B)


# Creating your own fortunes

Created: Sun Apr 14 02:51:00 CEST 2019

Last modified: Mon Apr 15 23:18:00 CEST 2019

---

*Just taking note of something don't mind me...*

Here is a sample fortune file:

<pre><code>one to three
%
four five six
%</code></pre>

Generate a `dat` file using strfile(1).

<pre><code>$ strfile fortunes</code></pre>

Typical output:

<pre><code>"fortunes.dat" created
There were 2 strings
Longest string: 6 bytes
Shortest string: 4 bytes</code></pre>

Then run fortune(1).

<pre><code>$ fortune ./my-fortune-file</code></pre>

Where `my-fortune-file` is without `.dat`.