blob: 8999d840d6bb0908858951bcd389a5505778b4c0 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
# Run verse(1) if it's installed and we haven't seen it already today (the
# verses are selected by date); run in a subshell to keep vars out of global
# namespace
if [[ $- == *i* ]] && hash verse 2>/dev/null ; then (
date=$(date +%Y-%m-%d)
versefile=${VERSEFILE:-$HOME/.verse}
if [[ -e "$HOME"/.verse ]] ; then
read -r lastversedate < "$versefile"
fi
if [[ "$date" > "$lastversedate" ]] ; then
verse
printf '\n'
printf '%s\n' "$date" > "$versefile"
fi
) ; fi
|