!/bin/bash
tomcat7=$(ps -ef | grep tomcat | wc -l)
echo ${#tomcat7}
if [ ${#tomcat7} -gt 0 ]; then
printf "tomcat is running\n"
else
printf "tomcat is not running\n"
fi
tomcat7=$(ps -ef | grep tomcat | wc -l)
if [ ${#tomcat7} -gt 0 ]; then
printf "tomcat is running\n"
else
printf "tomcat is not running\n"
fi