I use Tomcat 9.0.41 which comes bundled with an application. After the application was installed I try to run Tomcat by using the provided scripts. But those scripts throw a lot of errors like this:
./catalina.sh: 281: [[: not found
./catalina.sh: 286: [[: not found
./catalina.sh: 291: [[: not found
./catalina.sh: 295: [[: not found
./catalina.sh: 300: [[: not found
./catalina.sh: 305: [[: not found
./catalina.sh: 310: [[: not found
The line with the if
is line 281
:
#!/bin/sh
...
if [[ -n $SERVER_CERT_PATH && $SERVER_CERT_PATH != "" ]]; then
SRV_KS_PATH=$SERVER_CERT_PATH
fi
I checked several posts like this about scripts and the behaviour of [[
but haven't found a reason why these messages appear.
The environment I run all this in is Ubuntu 20.04, the test
utility exists.
When I force to use bash by calling bash catalina.sh
I don't see any errors. But for nested scripts like startup.sh
which inside calls catalina.sh
this doesn't work.
Is there a way to fix this ? I don't want to edit the scripts if possible. Perhaps I need to change some OS setting ? (which would make this more of a UNIX SE or askubuntu question)