while true
do
clear
date
echo AIX 630 AMOUNT OF FEPs
VAR=`ps -eaf | grep fep2 | grep cajaBMSz | wc -l`
{
if [ $? -gt 10 && -le 20 ]
then
if [ $? -ge 21 ]
then
printf "\033[01;31m%s\033[00m\n" "$VAR"
else
printf "\033[01;33m%s\033[00m\n" "$VAR"
fi
else
printf "\033[01;32m%s\033[00m\n" "$VAR"
fi
}
done;
What i want is this.. if the value returned by
ps -eaf | grep fep2 | grep cajaBMSz | wc -l
is between the values i suggested the script must output the colors i selected... but instead i get the "mon55z[22]: test: 0403-021 A ] character is missing." message. mon55z is the name of my script BTW...
thanks for the quick response and thank you for your observation, i've already modified that and what i got now is this:
{
if [ $VAR -gt 11 ]
then
if [ $VAR -ge 17 ]
then
printf "\033[01;31m%s\033[00m\n" "$VAR"
else
printf "\033[01;33m%s\033[00m\n" "$VAR"
fi
else
printf "\033[01;32m%s\033[00m\n" "$VAR"
fi
}
the error is gone, and the scrip is working all right. thank you !!!
---------- Post updated at 10:07 AM ---------- Previous update was at 10:05 AM ----------