blob: 078f111dea85ec577d576155bae2f0720f413fd1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
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
|