All that said I like python and there are tasks I absolutely prefer it for, usually anything to do with scraping some web API that returns a complex piece of JSON or xml.
All that said I like python and there are tasks I absolutely prefer it for, usually anything to do with scraping some web API that returns a complex piece of JSON or xml.
I am allowed to call 'mv' or 'cp' binaries from bash.
I am also allowed to call 'mv' or 'cp' binaries from python with subprocess!
(Edit: bad example binaries, 'df' or 'tar' would be probably better.)
I must choose not to install bash libraries for a bash script beyond builtins.
I can choose not to install python libraries beyond builtins.
It becomes a really simple tradeoff.
Nobody forces you to step out of python's stdlib. No extra dependencies. And you can still reap benefits of a proper programming language.
Python has its uses, but replacing shell scripts is not one of them IMO. It it was then the problem didn't need to be a shell script to begin with (doesn't shell out often, needs complex data structures, etc.).
A python script written ten years ago probably doesn't even parse on python3.0, let alone python3.6 (because there have been backwards incompatible changes since 3.0 even!).
And that's also true vice versa.
So like, this is to the point that there's some "reasonable subset" of python you can use to make it portable (ie. no external packages so you don't need to worry about pip vs. setuptools or venvs or whatever, let alone whether they'll build). I'm asserting that there is not.
Have you looked at the pathlib[1] module that was added in Python 3.4? It's fantastic. Makes things both more convenient and more correct, in my experience, and it lets you manipulate Windows paths on Unix and vice versa.