|
|
|
|
|
by lozenge
1146 days ago
|
|
Python stops on errors. Bash may or may not. It depends on how your script was called. If your script is sourced you need to remember to set and restore the flags. In bash your data can accidentally become code. "rm $fn" usually deletes one file, but it might one day delete a few (spaces), or wildcard expansion makes it delete many. With Python, calling the function to delete one file will always delete one file. Your function will never run with a "continue on errors" mode. |
|
and it's easy to add status checks to your shell script just like you can for Python. exceptions are not the only way to stop on error. but it's sure a hell of a lot easier to have a non-working program in Python, whereas it's a lot easier for a shell script to keep working.