title: Tomcat can't be run because of errors in catalina.sh
body: <p>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:</p>
  <pre><code>./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
  </code></pre>
  <p>The line with the <code>if</code> is line <code>281</code>:</p>
  <pre><code>#!/bin/sh
  ...
  if [[ -n $SERVER_CERT_PATH &amp;&amp; $SERVER_CERT_PATH != &quot;&quot; ]]; then
    SRV_KS_PATH=$SERVER_CERT_PATH
  fi
  </code></pre>
  <p>I checked several posts like <a href="https://stackoverflow.com/questions/9666102/bash-double-bracket-issue">this</a> about scripts and the behaviour of <code>[[</code> but haven't found a reason why these messages appear.
  The environment I run all this in is Ubuntu 20.04, the <code>test</code> utility exists.</p>
  <p>When I force to use bash by calling <code>bash catalina.sh</code> I don't see any errors. But for nested scripts like <code>startup.sh</code> which inside calls <code>catalina.sh</code> this doesn't work.</p>
  <p>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)</p>