Shell scripts and doing a good job don't go well together.
For simpler, more expressive Python system scripts use Plumbum: https://plumbum.readthedocs.io/
For simpler, more expressive Python system scripts use Plumbum: https://plumbum.readthedocs.io/