I was hoping someone finally had a library or something to make python good at the things shell does well (mostly, running stuff and piping output around). If only. This really just reads like someone who doesn't know shell and does know python, but thinks the problem is the tool. They continually describe shell with phrases like "obscure and difficult-to-predict" while talking through things that are either obvious…
Bashing the Bash – Replacing Shell Scripts with Python (2017)
31–40 of 138 posts
Re: Bashing the Bash – Replacing Shell Scripts with Python (2017)
#32I was hoping someone finally had a library or something to make python good at the things shell does well (mostly, running stuff and piping output around). If only. This really just reads like someone who doesn't know shell and does know python, but thinks the problem is the tool. They continually describe shell with phrases like "obscure and difficult-to-predict" while talking through things that are either obvious…
I've only kicked the tires on both, but plumbum:
https://plumbum.readthedocs.io/en/latest/
and sh: https://amoffat.github.io/sh/
both feel pretty good in that regard.
Re: Bashing the Bash – Replacing Shell Scripts with Python (2017)
#33Beware of Python devs writing Python shell scripts. They're used to using all the brand new (backwards incompatible) language features as soon as they come out. The vast majority have no consideration for a 10 year old PC running a 10 year old OS. The python3.x they write will not run. Bash, surprisingly, gets backwards incompatible language features too. But the vast majority of bash developers are writing for all c…
> The vast majority have no consideration for a 10 year old PC running a 10 year old OS. The python3.x they write will not run. Python3 is just under 14 years old.
Re: Bashing the Bash – Replacing Shell Scripts with Python (2017)
#34mkdir -p would create the directory without error. checking if a directory exists is trivial before creating it. Python throws an error if the path given to os.mkdir exists too.
This article is way too long to digest, so i should stop now.
Perhaps the argument should be, rewrite hacky things in bash as programs and build them into your apps?
Re: Bashing the Bash – Replacing Shell Scripts with Python (2017)
#35Beware of Python devs writing Python shell scripts. They're used to using all the brand new (backwards incompatible) language features as soon as they come out. The vast majority have no consideration for a 10 year old PC running a 10 year old OS. The python3.x they write will not run. Bash, surprisingly, gets backwards incompatible language features too. But the vast majority of bash developers are writing for all c…
> The vast majority have no consideration for a 10 year old PC running a 10 year old OS. The python3.x they write will not run. Python3 is just under 14 years old.
Re: Bashing the Bash – Replacing Shell Scripts with Python (2017)
#36I can probably run my bash script on every linux I ever touched.
I can probably have that python code break on half of the linux boxen I use. This one does not have module X installed. This one is too old, this one is too new, this python is not holding its mouth just at the right angle to work.
Yeah, bash bash all you want. I have pulled out scripts decades old and run them. I can not say the same for other things I have written.
Re: Bashing the Bash – Replacing Shell Scripts with Python (2017)
#37Re: Bashing the Bash – Replacing Shell Scripts with Python (2017)
#38I was hoping someone finally had a library or something to make python good at the things shell does well (mostly, running stuff and piping output around). If only. This really just reads like someone who doesn't know shell and does know python, but thinks the problem is the tool. They continually describe shell with phrases like "obscure and difficult-to-predict" while talking through things that are either obvious…
> I was hoping someone finally had a library or something to make python good at the things shell does well (mostly, running stuff and piping output around). If only. I've only kicked the tires on both, but plumbum: https://plumbum.readthedocs.io/en/latest/ and sh: https://amoffat.github.io/sh/ both feel pretty good in that regard.
For more centralized workflows, I could see Python shell replacements being helpful. Especially project specific scripts where the overhead of managing a venv is negligible.
But realistically replacing the majority of bash scripts? I just don’t see it.
Re: Bashing the Bash – Replacing Shell Scripts with Python (2017)
#39I was hoping someone finally had a library or something to make python good at the things shell does well (mostly, running stuff and piping output around). If only. This really just reads like someone who doesn't know shell and does know python, but thinks the problem is the tool. They continually describe shell with phrases like "obscure and difficult-to-predict" while talking through things that are either obvious…
Re: Bashing the Bash – Replacing Shell Scripts with Python (2017)
#40"Moving furniture by throwing it in the back of a pickup truck is obviously bad. Here's how to do it with a forklift and 18-wheeler instead, because this is definitely better."