#!/bin/bash # read only new mail messages #set -x bold=`tput bold;tput setaf 4` offbold=`tput sgr0` for M_BOX in $MAIL `find ~/Mail/ -maxdepth 1 -type f` do MESSAGES=`grep "^From " $M_BOX|wc -l` READMESS=`grep "^Status: RO" $M_BOX|wc -l` if [ "$MESSAGES" -ne "$READMESS" ] then echo "Changes for the mailbox ${bold}`basename $M_BOX`${offbold}:" mutt -f $M_BOX echo fi done echo "No more new messages." echo ""