The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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 01:01 PM
Error in the script krworks Shell Programming and Scripting 5 04-18-2008 01:31 AM
awk Shell Script error : "Syntax Error : `Split' unexpected Herry UNIX for Dummies Questions & Answers 2 03-17-2008 11:16 AM
script error MANISH KU Shell Programming and Scripting 5 09-01-2007 06:13 PM
error in awk script rraajjiibb Shell Programming and Scripting 7 06-10-2004 07:37 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 01-22-2008
Katkota Katkota is offline
Registered User
  
 

Join Date: Oct 2007
Posts: 115
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
  #2 (permalink)  
Old 01-22-2008
System Shock's Avatar
System Shock System Shock is offline Forum Advisor  
Registered User
  
 

Join Date: May 2006
Location: Tau Ceti V
Posts: 521
you are probably getting the error from catalina.sh, not the startup script.
  #3 (permalink)  
Old 01-22-2008
Katkota Katkota is offline
Registered User
  
 

Join Date: Oct 2007
Posts: 115
But i didn't touch the script
  #4 (permalink)  
Old 01-22-2008
System Shock's Avatar
System Shock System Shock is offline Forum Advisor  
Registered User
  
 

Join Date: May 2006
Location: Tau Ceti V
Posts: 521
..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.
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 02:41 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0