The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
when executing .sh script in telnet error "script not found" smiley Shell Programming and Scripting 1 04-22-2008 10:01 AM
Error in the script krworks Shell Programming and Scripting 5 04-17-2008 10:31 PM
awk Shell Script error : "Syntax Error : `Split' unexpected Herry UNIX for Dummies Questions & Answers 2 03-17-2008 07:16 AM
script error MANISH KU Shell Programming and Scripting 5 09-01-2007 03:13 PM
error in awk script rraajjiibb Shell Programming and Scripting 7 06-10-2004 04:37 AM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 01-22-2008
Registered User
 

Join Date: Oct 2007
Posts: 83
Stumble this Post!
Script error

folks;

I wrote this script for our Solaris 10 to restart an application we have on reboot, but every time i run this script to test i get this message:

then: then/endif not found
Would any one help with that?
thanks in advance

Here's the script:

#!/bin/sh
# chkconfig: 3 60 30
# description: Starts and stops application

mode=$1

TOMCAT_HOME=/opt/abc/apps
CATALINA_HOME=/opt/abc/apps
JAVA_HOME=/usr/jdk1.5.0_08
export TOMCAT_HOME CATALINA_HOME JAVA_HOME

case "$mode" in
'start')
# Start daemon
su - devuser -c "$TOMCAT_HOME/bin/catalina.sh $mode"
;;

'stop')
# Stop daemon. We use a signal here to avoid having to know the
# root password.
$TOMCAT_HOME/bin/catalina.sh $mode
;;

*)
# usage
echo "usage: $0 start|stop"
exit 1
;;
esac
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 01-22-2008
System Shock's Avatar
Registered User
 

Join Date: May 2006
Location: Tau Ceti V
Posts: 378
Stumble this Post!
you are probably getting the error from catalina.sh, not the startup script.
Reply With Quote
  #3 (permalink)  
Old 01-22-2008
Registered User
 

Join Date: Oct 2007
Posts: 83
Stumble this Post!
But i didn't touch the script
Reply With Quote
  #4 (permalink)  
Old 01-22-2008
System Shock's Avatar
Registered User
 

Join Date: May 2006
Location: Tau Ceti V
Posts: 378
Stumble this Post!
..yeah, but you are calling it.

Let's say I have a script called tester that calls a script named script2...

Code:
# cat tester

/opt/script2

#
Now, script2 has a syntax error; in this case, ommited the "fi" at the end of it.

Code:
# cat /opt/script2

COUNT=0
if (( ${COUNT} < 3 )); then
echo "is bigger"
else

#
If I run tester, I get:
Code:
# ./tester

/opt/script2[2]: syntax error at line 4 : `else' unmatched

#
I don't see an if/then statement in your script, so it must be from catalina.sh, or something else catalina.sh is calling.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 04:15 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0