|
Home > Archive > Unix questions > October 2005 > force to process every command completely in sh script
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
force to process every command completely in sh script
|
|
| arashamiri@hotmail.com 2005-10-24, 3:46 pm |
| hi,
i have a stop.sh script to stop my tomcat server.
it contains the following two lines:
######################
/srv/server/jakarta-tomcat-5.5.0/bin/catalina.sh stop
kill $PID
#####################
where $PID is the process id of the tomcat server.
when I run this script, the "kill" command terminates the "stop"
command before
it has finished stopping the server.
how can i force the script to run each command after the one before is
finished?
greetings, arash.
| |
| Bill Marcum 2005-10-24, 3:46 pm |
| On 20 Oct 2005 09:20:07 -0700, arashamiri@hotmail.com
<arashamiri@hotmail.com> wrote:
> hi,
> i have a stop.sh script to stop my tomcat server.
> it contains the following two lines:
>
>
> ######################
> /srv/server/jakarta-tomcat-5.5.0/bin/catalina.sh stop
> kill $PID
> #####################
>
> where $PID is the process id of the tomcat server.
>
>
>
> when I run this script, the "kill" command terminates the "stop"
> command before
> it has finished stopping the server.
>
>
> how can i force the script to run each command after the one before is
> finished?
>
Usually that is how it works unless you use "&". The catalina.sh script
probably contains an "&". Try this:
/srv/server/jakarta-tomcat-5.5.0/bin/catalina.sh stop
sleep 10
kill $PID
--
HERE LIES LESTER MOORE
SHOT 4 TIMES WITH A .44
NO LES
NO MOORE -- tombstone, in Tombstone, AZ
|
|
|
|
|