3 ms·
I have some bad news for you, from a long, long, long time CS/EE/Sysadmin person: I can probably run my bash script on every linux I ever touched. I can proba
by readingnews 5y ago
I have some bad news for you, from a long, long, long time CS/EE/Sysadmin person:
I 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.
- drewcoo 5y agoBut which one is more likely to also run on Windows? /s
- yjftsjthsd-h 5y ago... Hilariously, I think shell might actually win that; neither is installed by default, but you get some sort of bash/sh with any of interix, WSL1/2, git, cygwin, or mingw.
- DyslexicAtheist 5y agoisn't WSL like a hypervisor that runs a guest? I'm clueless about Windows but when I start a WSL it is usually some form of Debian or Ubuntu that I can download from the Microsoft "store". Therefore isn't the shell you have whatever comes with that guest?
- rawoke083600 5y ago>I can probably run my bash script on every linux I ever touched. Exactly THIS !
- DyslexicAtheist 5y agoyeah python (and before perl with cpan) had these issues that maintaining a consistent system is more effort than writing the damn thing in the first place. I loved Perl but tried to avoid modules like the plague. And python is almost worse because the same mentality (avoid modules) was abandoned by most of the community so now you get incompatibilities with what the OS provides and what gets installed via pip. Perhaps it's unfair to pick at python for this when many of these issues are not the language but because people picking python when they should have just used shell script.
- nijave 5y agoI have the same issue with bash scripts. One host has jq, another is missing it. One host has yq version 2 with completely different syntax than yq version 4. If you switch from Linux to *nix where you introduce BSD variants (like macOS) it gets even worse. Python dependency management leaves much to be desired but bash has none.
- lsferreira42 5y agoThat's why you try to write scripts for standard tools and shell features
- nijave 5y agoWhat are standard tools and shell features? Bash + GNU? Those might be consistently installed on common Linux distros but that doesn't work across *nix systems (Linux, macOS, BSD). That probably won't work against less-common Linux setups like anything embedded (busybox or container images) either