bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

checkmail problem


From: Leung buggy
Subject: checkmail problem
Date: Wed, 25 Apr 2001 03:25:41 -0400

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??




reply via email to

[Prev in Thread] Current Thread [Next in Thread]