Generate specific, non-zero return code?
<p>I am working on some piece of python code that calls various linux tools (like ssh) for automation purposes. Right now I am looking into "return code" handling. </p>

<p>Thus: I am looking for a simple way to run <em>some</em> command that gives me a specific non-zero return code; something like</p>

<pre><code>echo "this is a testcommand, that should return with rc=5"
</code></pre>

<p>for example. But of course, the above comes back with rc=0.</p>

<p>I know that I can call <code>false</code>, but this will always return with rc=1. I am looking for something that gives me an rc that I can control.</p>

<p>Edit: first answers suggest to <em>exit</em>; but the problem with that: <em>exit</em> is a bash function. So, when I try to run that from within a python script, I get "No such file or directory: exit". </p>

<p>So, I am actually looking for some "binary" tool that gives me that (obviously one can write some simple script to get that; I am just looking if there is something similar to <em>false</em> that is already shipped with any Linux/Unix).</p>