Within my shell script I run this command:
python script.py
I was wondering, as a two part question:
How can I program my python script to pass a status back to the shell script that ran it depending on what happens in the python script. For example if something goes wrong in the python script have it exit with a code of 1 which is sent back to shell.
How can I get my shell script to read the exit code of python and exit for an error? For example, a status code of anything but 0 then exit.