i'm doing a assignment to write a script to check how many new mail i have
under linux or unix.
if [ $# -ne 0 ]
then
echo $0 "take no parameter!!"
else
no_mail=`mail -i | head -2 | tail -1 | cut -f2,3 -d' '`
check_mail=`echo $no_mail | cut -f2 -d' '`
if [ -z $check_mail ]
then
echo "You have no mail"
else
echo "You have" $no_mail
fi
fi
but the problem is "mail -i " need me to press 'q' to continue the run of
script, is any better method to check how many new mail??