How to shutdown jshell at the end of the script? : <p>How to instruct <code>jshell</code> to terminate at the end of the script similarly to interpreters of other languages like for example <code>python3</code> or <code>node</code>?</p>

<p>Following command</p>

<pre><code>./jshell -q /tmp/shell.java
</code></pre>

<p>with script <code>/tmp/shell.java</code></p>

<pre class="lang-java prettyprint-override"><code>System.out.println("Hello world");
</code></pre>

<p>prints</p>

<pre class="lang-none prettyprint-override"><code>Hello world
jshell&gt; 
</code></pre>

<p>and waits for further commands. I'd like it to stop immediately at the end of the file.</p>

<p>I'm looking for something more elegant than <code>System.exit(0);</code> at the end of the script.</p>
