From 466c31cd91e5576405af190f76c073e1d06a4482 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Thu, 18 Sep 2014 18:11:07 -0300 Subject: Sorting scripts --- checkmail | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100755 checkmail (limited to 'checkmail') 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 -- cgit v1.2.3