Quote:
Originally Posted by Corona688
Since you've posted no code there's no way to tell but psychic powers, but I'm guessing that it's complaining about not having a search string. It would be really nice to see the code.
Basically there are two funtion that I am using, this function will check for the current process.
checkProcess ()
{
PROCESS=$1
PROC_NOT_RUN=`$PS -ef | $GREP -i "$PROCESS" | $GREP -v "grep" | $WC -l` #determine how many times are the process is running
echo "Process Not Run $PROC_NOT_RUN"
return $PROC_NOT_RUN
}
This is my main funtion, I still not able to find out what was wrong, I have a feeling that when using grep and awk in one line it might cause the problem
$CAT $CONF_DEAMON | $AWK '{print $1}' | $GREP -v "^\#" | \
while read SERVICES
do
SERVICES_PATH=`$CAT $CONF_DEAMON | $GREP -v "^#[[:space:]]" | $GREP "^$SERVICES" | $AWK '{print $2}'`
# 1. Check for the process
checkProcess $SERVICES
if [ $? -eq $SUCCESS ]
then
echo $?
#addErrMSG "$SERVICES is currently not running please review the process under the path of $SERVICES_PATH"
#Send_Email
fi
done
Thanks for your help