[/code][/quote]
one thing you can do... is check to see where the script is bombing.
like directly after assigning the variables, "old" and "new", see what they were assigned with.
Code:
echo "${old} is old amount"; echo "${new} is the new amount"
I think you will see that old and new have stuff other than numbers

YMMV
Now, is it telling you the same message everytime? The "You have mail" or is it saying "You have new mail" everytime?
one thing I would change too... just for testing... is the elif statement.
instead of:
Code:
elif [ "$old" != "$new" ]
just use
Code:
else
and see which message you get everytime.
and post

[/quote]
Well did what you guys said:
I rewrote the script this way'
while [ $USER = (name) ]
do
old=`wc -l /var/spool/mail/$USER`
new=`wc -l /var/spool/mail/$USER`
if [ "$old" = "$old" ]
then
echo "$old"
echo "$USER, You have mail"
else [ "$new" != "$old" ]
echo "$new"
echo "$USER, You have new mail"
fi
done
It stays at the ("$USER, You have mail")
it never pass that line even if i send myself new mail.
it as if it dosent evalluate the new (wc -l) of the new message.
It echo ($old) all the time:never the ($new). The only thing that
works is the loop;
From what i can see, is it add the new count to the old:
It never pass the first (if) dosent go to the (else) for the new count::cry:
I am not good enough to debug this scripts yet: I just can't figure it out;
