I have an python script which gets input from arguments. can I place this as an condition in if statement of bash script ? If python script ends with an error (exit 1) it has to trigger another python script and if python script ends with 0 then no action required. I thought to do it via if condition in bash script. I am erroring out in the code.
#!/bin/bash
if [ "python pythonscript.py argument" == 1 ]; then
python pythonscript2.py argument
fi
exit 0
Same argument is passed to both python scripts. argument is a string like something_Dept-envi. I get nothing when I execute above no syntax error at the same time nothing happens
#!/bin/bash
if [ "python pythonscript.py argument" == 1 ]; then
python pythonscript2.py argument
fi
exit 0
If python script ends with an error (exit code 1), i want another python code to be executed with argument else exit o