#!/bin/sh # Why not? readonly tmpl="${XDG_DATA_HOME:-$HOME/.local/share}/send-package/template" sed -En '/^Angel Cakes/,/^Doozies/s/(\t|\s{2,})/\n/gp' ~/doc/tit-names \ | shuf -n1 \ | xargs -I{} -- sed 's/$REPLACEME/{}/' "$tmpl" \ | msmtp --read-envelope-from "$TO"