diff options
-rwxr-xr-x | unread-mails | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/unread-mails b/unread-mails index 75c7aaf..37f3a97 100755 --- a/unread-mails +++ b/unread-mails @@ -5,6 +5,7 @@ # Setup MAIL="$HOME/mail" +INBOX="$MAIL/INBOX" # Check if [ ! -d "$MAIL" ]; then @@ -12,9 +13,17 @@ if [ ! -d "$MAIL" ]; then fi # Calculate -TOTAL="`find $MAIL -maxdepth 2 -name 'new' -exec ls {} \;`" +TOTAL="`find $MAIL -maxdepth 2 -name 'new' -exec ls {} \; | wc -l`" # Print -if [ ! -z "$TOTAL" ] && [ "$TOTAL" != "0" ]; then +if [ "$TOTAL" != "0" ]; then echo $TOTAL unread emails. fi + +# Current on INBOX +TOTAL="`ls -1 $INBOX/cur/ | wc -l`" + +# Print +if [ "$TOTAL" != "0" ]; then + echo $TOTAL mails dangling at the INBOX. +fi |