aboutsummaryrefslogtreecommitdiff
path: root/bash/bash_profile.d/verse.bash
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2016-08-20 00:43:35 +1200
committerTom Ryder <tom@sanctum.geek.nz>2016-08-20 01:21:09 +1200
commit1ce0e2ad424bf38768094488774eff23b3871ccc (patch)
treeb9d407b2fb7729456ce554d4d610a194447ad737 /bash/bash_profile.d/verse.bash
parentUse terser shell for executable installs (diff)
downloaddotfiles-1ce0e2ad424bf38768094488774eff23b3871ccc.tar.gz
dotfiles-1ce0e2ad424bf38768094488774eff23b3871ccc.zip
Port all bash_profile.d scripts to POSIX sh
Also require flag files in ~/.welcome for displaying or not displaying login stuff
Diffstat (limited to 'bash/bash_profile.d/verse.bash')
-rw-r--r--bash/bash_profile.d/verse.bash24
1 files changed, 0 insertions, 24 deletions
diff --git a/bash/bash_profile.d/verse.bash b/bash/bash_profile.d/verse.bash
deleted file mode 100644
index 69c48021..00000000
--- a/bash/bash_profile.d/verse.bash
+++ /dev/null
@@ -1,24 +0,0 @@
-# Only if shell is interactive
-if [[ $- != *i* ]] ; then
- return
-fi
-
-# Only if verse(1) available
-if ! hash verse 2>/dev/null ; then
- return
-fi
-
-# Run verse(1) if we haven't seen it already today (the verses are selected by
-# date); run in a subshell to keep vars out of global namespace
-(
- date=$(date +%Y-%m-%d)
- versefile=${VERSEFILE:-$HOME/.verse}
- if [[ -e $versefile ]] ; then
- IFS= read -r lastversedate < "$versefile"
- fi
- if [[ $date > $lastversedate ]] ; then
- verse
- printf '\n'
- printf '%s\n' "$date" > "$versefile"
- fi
-)