I am new to shell scripting. I was trying to write a script to which is throwing an unexpected end of file error. I have check other solutions on stackoverflow, however I coul not solve the here. Any help would be appreciated. My script is
if [ "$(/etc/init.d/tomcat7 status)" == " * Tomcat servlet engine is not running." ]; then /etc/init.d/tomcat7 start; fi
As suggested I tried creating this in linux and now I get an error [: * Tomcat servlet engine is not running.: unexpected operator