32 ms·
I always hear people talk about writing portable, POSIX compliant shell scripts so they'll work in more environments (assuming those environments are needed, of
by jjice 3y ago
I always hear people talk about writing portable, POSIX compliant shell scripts so they'll work in more environments (assuming those environments are needed, of course), but how often do you run into an environment where you don't have a fairly complete version of Bash available? Genuine open question, I'd be really interested to know what that situation is. Lean container images, embedded, older systems? I'm really curious.
- rascul 3y agoI put a recent bash everywhere I need to work. Not everyone can, though.
- pletnes 3y agoContainers/docker/kubernetes and embedded systems that use e.g busybox is what I’ve seen. Also macOS (used to?) ship ancient bash versions, but there’s recent zsh so that’s mostly fine.
- js2 3y agoYes, macOS is stuck with bash 3 due to the license change with bash 4 and now ships with zsh as the default shell.
- yubiox 3y agoAIX, Solaris, HP-UX
- nrclark 3y agoIt's really common for embedded systems to ship without Bash. I don't include it in the production firmware on any systems that I design.
- ndsipa_pomu 3y agoNetwork equipment can often use a cut down version of Linux or flavour of BSD and they don't always include BASH
- inferiorhuman 3y agoThe BSDs all come with some non-bash POSIX shell in /bin/sh, and while bash is available via ports it won't be installed at /bin/bash. The solution is, do as little with shell scripts as possible to bootstrap a more workable environment.