File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Tomcat and the fly likes Decode Tomcat script. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Decode Tomcat script." Watch "Decode Tomcat script." New topic

Decode Tomcat script.

Bruce Jin
Ranch Hand

Joined: Sep 20, 2001
Posts: 666
Decode Tomcat script. contains these lines. Can anyone help explain what do they do? Thanks!

# resolve links - $0 may be a softlink

while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '.*/.*' > /dev/null; then
PRG=`dirname "$PRG"`/"$link"

PRGDIR=`dirname "$PRG"`

# Check that target executable exists
if [ ! -x "$PRGDIR"/"$EXECUTABLE" ]; then
echo "Cannot find $PRGDIR/$EXECUTABLE"
echo "This file is needed to run this program"
exit 1

exec "$PRGDIR"/"$EXECUTABLE" start "$@"

We love Java programming. It is contagious, very cool, and lot of fun. - Peter Coad, Java Design

Crazy Bikes created by m-Power
I agree. Here's the link:
subject: Decode Tomcat script.
Similar Threads
Java and Shell scripts
error starting up 2nd instance of tomcat
Multiple instances of Tomcat 6, class loading experiencing problems for each instance
Trouble running tomcat on Ubuntu Linux.
Tomcat fails to restart with "Address already in use" exception