aboutsummaryrefslogtreecommitdiff
path: root/checkmail
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2014-09-18 18:11:07 -0300
committerSilvio Rhatto <rhatto@riseup.net>2014-09-18 18:11:07 -0300
commit466c31cd91e5576405af190f76c073e1d06a4482 (patch)
tree1a12427f1704b0b0085a8f686f0424d54eb3172f /checkmail
parentf32ec8c49226dc860c38a2c36d7587d1d27419b8 (diff)
downloadutils-mail-466c31cd91e5576405af190f76c073e1d06a4482.tar.gz
utils-mail-466c31cd91e5576405af190f76c073e1d06a4482.tar.bz2
Sorting scripts
Diffstat (limited to 'checkmail')
-rwxr-xr-xcheckmail14
1 files changed, 14 insertions, 0 deletions
diff --git a/checkmail b/checkmail
new file mode 100755
index 0000000..078f111
--- /dev/null
+++ b/checkmail
@@ -0,0 +1,14 @@
+#!/bin/bash
+#
+# Simple mail counter
+# Inspired by http://www.vivaolinux.com.br/dicas/verDica.php?codigo=2432
+#
+
+# Fetch and compute
+FETCH=`fetchmail -c`
+TOTAL=`echo $FETCH | awk '{ print $1 }'`
+SEEN=`echo $FETCH | awk '{ print $3 }' | sed -e 's/(//'`
+NEW=`echo "$TOTAL - $SEEN" | bc`
+
+# Display response
+echo $NEW/$TOTAL