I'm completely puzzled by this behavior of Tomcat 9.0.21 startup script catalina.sh:
# following line added by me echo "CATALINA_HOME" # following line added by me echo $have_tty if [ $have_tty -eq 1 ]; then # following line added by me echo "CATALINA_HOME" echo "Using CATALINA_BASE: $CATALINA_BASE" echo "Using CATALINA_HOME: $CATALINA_HOME" echo "Using CATALINA_TMPDIR: $CATALINA_TMPDIR" if [ "$1" = "debug" ] ; then echo "Using JAVA_HOME: $JAVA_HOME" else echo "Using JRE_HOME: $JRE_HOME" fi echo "Using CLASSPATH: $CLASSPATH" if [ ! -z "$CATALINA_PID" ]; then echo "Using CATALINA_PID: $CATALINA_PID" fi fi
Now when I run
catalina version | grep CATALINA_HOME I cannot see any result with the original script version.
In my modified version of script I can only see what's echo-ed before the 'if have_tty' section!
catalina | grep CATALINA CATALINA_HOME
I'd expect to see also the next CATALINA_HOME echo-ed from within the if block as well as the "Using CATALINA_HOME ..." line.
What's going on there?
(If it matters I'm running Mac OS X 10.14.5 with iTerm and zsh as my shell)
People commented that it's because the
have_tty variable isn't set but that's not a problem in my case.
When I just run
catalina version I get the full output:
CATALINA_HOME 1 CATALINA_HOME Using CATALINA_BASE: /usr/local/Cellar/tomcat/9.0.21/libexec Using CATALINA_HOME: /usr/local/Cellar/tomcat/9.0.21/libexec Using CATALINA_TMPDIR: /usr/local/Cellar/tomcat/9.0.21/libexec/temp Using JRE_HOME: /Users/jumar/.jenv/versions/126.96.36.199 Using CLASSPATH: /usr/local/Cellar/tomcat/9.0.21/libexec/bin/bootstrap.jar:/usr/local/Cellar/tomcat/9.0.21/libexec/bin/tomcat-juli.jar Server version: Apache Tomcat/9.0.21 ...
It's just with the pipe (grep) that things start looking weird:
catalina version | grep CATALINA_HOME CATALINA_HOME # here should be the missing "Using CATALINA_HOME..."