dotfiles/dot_local/bin/executable_bofh
2023-05-02 10:01:13 +02:00

6 lines
217 B
Bash

#!/usr/bin/env bash
excuses_file="$HOME/.local/share/bofh"
num_lines=$(nl "$excuses_file" | tail -n 1 | awk '{print $1}')
echo -n "Daily Excuse: "
awk 'NR=='$((1 + RANDOM % num_lines ))'{print;exit}' "$excuses_file"