I’m not sure how you’re measuring overhead, or exactly what you’re claiming. Looking athow the shell uses fork and exec to spawn subshells, I think you’ll find Python is considerably faster. It’s difficult to share benchmarks because Python code lets you rewrite and simplify shell code, leading to the complaint that the benchmark is comparing apples and oranges. However, Python tends to be quite a bit faster overall. If you have some comparison numbers, that’s an interesting thing to look at. In particular, the startup cost of shell vs. Python and when that cost outweighs the overall cost of the processing is interesting.
The set -e doesn’t really behave anything like a try/except block, so I’m not sure what you’re suggesting. An example would be really helpful here.
