dotfiles/dot_local/bin/executable_bofh

5 lines
No EOL
195 B
Bash

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