I have a Python script that returns a status when it finishes (but not through an output).

```
sys.exit(status)

```

And I have to run a bash command that uses that status, the execution is something like:

```
command --host=xxx --service="xxx" --message="`myscript.py`" -s "ip" -u "user" -p "pass" " --returncode=0

```

Is there any way to take the return code directly from the "sys.exit(status)"?

I tried changing `--returncode=0` to `--returncode=$?` but it does not work.