Results 1 to 4 of 4
Hi all,
I'm wondering if anyone can spot some errors in this script.
I'm only really interested in Syntax errors (or logical ones if they are blatant!)
I have not ...
- 08-14-2007 #1Just Joined!
- Join Date
- Aug 2007
- Posts
- 2
Hi all,
I'm wondering if anyone can spot some errors in this script.
I'm only really interested in Syntax errors (or logical ones if they are blatant!)
I have not run this script yet, the Linux machine is not yet available.
I'm looking for a heads up on obvious syntax errors before I let her rip..
Thanks in Advance,
Patrick
You can assume that the VARIABLES MOM_HOME and JAVA_HOME are well defined.
-----------------------------------------------------------------------------------------
--------------------------------------------------------------------------Code:#!/bin/sh -vx ################################################## ##### # ################################################## ##### # Verify if MOM_HOME is well defined if [ -f $MOM_HOME/tests/tests.jar ] then # Verify if JAVA_HOME is well defined if [ -f $JAVA_HOME/bin/java ] then export HOST=10.1.1.50 export CLASSPATH=$MOM_HOME/joram-mom.jar export CLASSPATH=$CLASSPATH;$MOM_HOME/JCup.jar export CLASSPATH=$CLASSPATH;$MOM_HOME/spring-core.jar export CLASSPATH=$CLASSPATH;$MOM_HOME/spring-dao.jar export CLASSPATH=$CLASSPATH;$MOM_HOME/spring-jdbc.jar export CLASSPATH=$CLASSPATH;$MOM_HOME/spring-jmx.jar export CLASSPATH=$CLASSPATH;$MOM_HOME/spring-web.jar export CLASSPATH=$CLASSPATH;$MOM_HOME/tests/tests.jar export CLASSPATH=$CLASSPATH;$MOM_HOME/tests/junit-4.1.jar $JAVA_HOME/bin/java -classpath $CLASSPATH com.babelnetworks.service.messaging.impl.Util $HOST root root intTestCleanup 0 $JAVA_HOME/bin/java -classpath $CLASSPATH com.babelnetworks.service.messaging.impl.Util $HOST root root intTestSetup 0 $JAVA_HOME/bin/java -classpath $CLASSPATH com.babelnetworks.service.messaging.impl.Util $HOST root root info else echo "The JAVA_HOME environment variable is not defined correctly" fi else echo "The MOM_HOME environment variable is not defined correctly" fi #ENDLast edited by devils casper; 08-14-2007 at 04:25 PM. Reason: Posts merged.
- 08-14-2007 #2Linux Engineer
- Join Date
- Feb 2005
- Posts
- 1,044
I think your CLASSPATH will work better with colon separators, not semicolons. This isn't a toy system, remember!
- 08-14-2007 #3
A couple notes:
- /bin/sh is actually just a symlink to /bin/bash on most GNU/Linux systems, FWIW.
- You can check for syntax errors on your own.
Example: bash -n /path/to/script
- 08-16-2007 #4Just Joined!
- Join Date
- Aug 2007
- Posts
- 2


Reply With Quote
