Comment by m463
3 days ago
if bash/sh scripts get too long (or long-lived), I switch to python when possible.
As a minor example, I hate having to remember (or explain) ${var##pattern}
It is useful for manipulating paths, but it is cryptic.
in comparison, something like:
newfile = os.path.join(newpath, os.path.basename(oldpath))
IMHO is more self-explanatory and robust.
Also, argparse is the best.
That's because you don't use the native lib pathlib from python ! It was a delivery when I knew about it. For example, to join paths, you can do so much easily, see the section "operators" of this link : https://docs.python.org/3/library/pathlib.html