A quick question:
If i have a while loop which looks for totals and if two totals don't match then output a message in an email as a warning, this loop goes round four times.
I want to only email the person if a set of figures does not match. to do this i was going to put it in an if statement after the while loop. see below:
if [ $ATTENTION = ON ]
then
#email all users
mailx -r $MAIL_FROM -s "xxxxx Counts WARNING: ERROR CHECK" $EMAIL < $MSG_DEST
fi
the problem is during the loop the first set of data might set $ATTENTION to ON but the rest might be off. When i echo the $ATTENTION it says OFF so the above loop does not work. So what do i want to do is basically say if $ATTENTION is at any time set to ON then email??
how can this be done?