I'm trying to write a script that restarts tomcat, but can't figure out what my problem is.
if I execute the following command at the command prompt it runs fine:
/usr/local/etc/rc.d/tomcat7 start However, inside myshell.sh script I tried to run the same command with and without backticks as follows:
rc=`/usr/local/etc/rc.d/tomcat7 start` rc=/usr/local/etc/rc.d/tomcat7 start rc=$(/usr/local/etc/rc.d/tomcat7 start) but nothing happens and I don't get any errors output.
What can it run at the command prompt, but not inside my shell script?
Thanks in advance.

bash -x /path/to/scriptto see exactly what its doing.