4 ms·
> I don’t know why I don’t hear this point get more airtime among people when discussing the pros and cons of Python/Perl as scripting languages. But it is. P
by m1keil 2y ago
> I don’t know why I don’t hear this point get more airtime among people when discussing the pros and cons of Python/Perl as scripting languages.
But it is.
Perl and awk one liners are very common. Bash is used everywhere you have the (controversial) `sudo curl .. | bash -` install method.
Ansible, if I'm not mistaken, requires python3 installed on remote hosts.
If your environments are homogeneous enough, and you don't have a large matrix of operating systems, you should definitely use this advantage.
The troubles start when you have very heterogeneous environment, custom or hardened Linux distros and etc.
It might seem like this is not being utilised as much nowadays, but I suspect it's because the "classical" Linux sysadmin roles are rare and you don't hear about it as much.
- hiAndrewQuinn 2y agoHaving recently started to experiment a lot with the BSDs (mostly Free, a little Open), which often don't come with even Bash out of the box (usually still Perl though), I can definitely relate to this. The more complex your workplace's OS ecosystem, the harder it gets to write anything which will truly run everywhere, unless you go all the way down to POSIX shell.
- m1keil 2y agoYep. I assume everyone already knows that, but shellcheck is great help if you need to go all the way down to POSIX since it will detect /bin/sh shebang and warn about any non-compatible bash-ism.
- em500 2y agoWhere does the expectation come from that Bash should come ootb with BSD? Or anywhere else outside of mainstream Linux distributions with GNU userland? Bash is the standard Bourne/Korn-like shell for the GNU project, which was envisioned as a FSF Unix clone/replacement. BSD and other Unix-like systems pretty much always had their own separate userland, with often different syntax than the GNU tools. I think the odd one out was really Apple, which ran Bash as the standard shell for many years (a choice they probably regret), while most the rest of the userland was largely from BSD.
- alexey-salmin 2y agoNo one says it's an expectation or an obligation. It's a matter of fact: there's no bash and it is obviously inconvenient for people used to bash, that's it.
- bionsystem 2y agoHave you tried cfengine ? I'd be curious of the feedback in heterogeneous environments.
- kodama-lens 2y ago> Ansible, if I'm not mistaken, requires python3 installed on remote hosts. It is not a requirement. There is the raw module that just sends commands over ssh . But if you want to do anything beyond basic most people use raw just to install python so they can use other modules which require python.
- m1keil 2y agomakes sense, thanks for the correction.