Just change it to zip foo.sh + foo.py. Then:
cat foo.sh
#!/bin/bash -e
./foo.py
cat foo.py
# Everything else has moved here.
Much better.
Just change it to zip foo.sh + foo.py. Then:
cat foo.sh
#!/bin/bash -e
./foo.py
cat foo.py
# Everything else has moved here.
Much better.
You now have two files to do one thing, and your solution doesn't work (it doesn't pass the arguments from the shell script to the python, or pass the exit code back, and it's making an extra process which can screw up monitoring). You could add the extra code to make it work; but even if you did, you're going to a lot of extra effort to become equal, not better :P
And I'm not sure how a script that calls another script screws up monitoring.
Plus, if someone cares about high level stuff like monitoring but is worried that people's tools might break if he changes script.sh to script.py later on, I think he needs to sort out the lower level stuff first. Like distribution and packaging :)