I am calling a python script from within a shell script. The python script returns error codes in case of failures.
How do I handle these error codes in shell scrip
The exit code of last command is contained in $?.
$?
Use below pseudo code:
python myPythonScript.py ret=$? if [ $ret -ne 0 ]; then #Handle failure #exit if required fi