Counting the number of exit variables - Bash.
Is there a way to count the number of errors- an exit variable $? from one function?
precat1 ()
{
grep -i $CODE $TEST
if [ "$?" -eq "1" ]; then
echo "Warning, no response. 1" >> $MSG
mail -s"$SUB" "$TO" < $MSG
fi
grep -i $CODE $TEST
if [ "$?" -eq "1" ]; then
echo "Warning, no response. 1" >> $MSG
mail -s"$SUB" "$TO" < $MSG
fi
grep -i $CODE $TEST
if [ "$?" -eq "1" ]; then
echo "Warning, no response. 1" >> $MSG
mail -s"$SUB" "$TO" < $MSG
fi
grep -i $CODE $TEST
if [ "$?" -eq "1" ]; then
echo "Warning, no response. 1" >> $MSG
mail -s"$SUB" "$TO" < $MSG
fi
}
the output from the exit variable (either erroneous or correct (1) or (0)) is it possible to add the erroneous one ups?
-Thanks in Advance.
|