Sorry, shell scripting once more, recent changes break the script on
Solaris. Details below.
On 28.09.2010 23:20, ma...@apache.org wrote:
Author: markt
Date: Tue Sep 28 21:20:06 2010
New Revision: 1002359
URL: http://svn.apache.org/viewvc?rev=1002359&view=rev
Log:
Respond to mturk's review. Make rm more robust. Avoid potential issues with
(...).
Modified:
tomcat/trunk/bin/catalina.sh
Modified: tomcat/trunk/bin/catalina.sh
URL:
http://svn.apache.org/viewvc/tomcat/trunk/bin/catalina.sh?rev=1002359&r1=1002358&r2=1002359&view=diff
==============================================================================
--- tomcat/trunk/bin/catalina.sh (original)
+++ tomcat/trunk/bin/catalina.sh Tue Sep 28 21:20:06 2010
...
@@ -370,7 +376,7 @@ elif [ "$1" = "start" ] ; then
fi
- if [ ! -z "$CATALINA_PID" ]; then
+ if [ ! -z "$CATALINA_PID" -a ! -e "$CATALINA_PID" ]; then
echo $!> $CATALINA_PID
fi
The operator "-e" does not always exist. For instance /bin/sh on Solaris
does not have it, so it bombs with
./test.sh: test: argument expected
It does exist for ksh and bash, but not for plain old sh, which we
choose to use via the header "#!/bin/sh".
The following approximations can be used:
-r filename: True if filename exists and is readable.
-w filename: True if filename exists and is writable.
-f filename: True if filename exists and is a regular file,
(so especially not a directory. Implementations vary
about result for symbolic links, pipes etc.)
-d filename: True if filename exists and is a directory.
-h filename: True if filename exists and is a symbolic link.
-c filename: True if filename exists and is a character special file.
-b filename: True if filename exists and is a block special file.
-p filename: True if filename exists and is a named pipe (fifo).
-s filename: True if filename exists and has a size greater than zero.
-L filename: True if filename exists and is a symbolic link.
I'd say "-f" is the best approximation of what we have, "-w" would make
most sense (unlikely someone specifies a directory for CATALINA_PID),
and if we want to increase chances it almost always works it'll be "-f
... -a -w ...".
The same applies to TC 6 since this was already backported.
Regards,
Rainer
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org