aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2020-05-05 09:57:50 +1200
committerTom Ryder <tom@sanctum.geek.nz>2020-05-05 09:57:50 +1200
commit6ce3785931e310e67be93ab373e2a153710b5807 (patch)
treec489d9c91f2a999ab71dc4db418becdf45330eee /bin
parentAdd Bcc and terminating columns to Mutt pager hdrs (diff)
downloaddotfiles-6ce3785931e310e67be93ab373e2a153710b5807.tar.gz
dotfiles-6ce3785931e310e67be93ab373e2a153710b5807.zip
Add msc(1df)
Diffstat (limited to 'bin')
-rwxr-xr-xbin/msc.sh12
1 files changed, 12 insertions, 0 deletions
diff --git a/bin/msc.sh b/bin/msc.sh
new file mode 100755
index 00000000..feb39b14
--- /dev/null
+++ b/bin/msc.sh
@@ -0,0 +1,12 @@
+# Crudely but quickly count mail in the user's inbox, if we can find it
+username=$(id -nu)
+if [ "$#" -eq 0 ] ; then
+ set -- "$MAIL" /var/mail/"$username" /var/spool/mail/"$username"
+fi
+for path ; do
+ [ -e "$path" ] || continue
+ grep -ch -- '^From ' "$path"
+ exit
+done
+printf >&2 'Couldn'\''t find user mail spool; provide it as an argument...?\n'
+exit 1