Skip to content

Comment on Advanced Bash Scriptingparent

Comments

> in any situation where you need absolute portability or availability on an otherwise bare system, bash is the way to go.

Interestingly, this is why Debian uses dash: A smaller shell is more portable.

How is that portable, across different architectures?

I have to work in Solaris, SUSE SLES, some other linux where I don't know what they run, and OS X and I don't have root on most of those. bash seems to work the same everywhere and always seems to be there when I get access to a newly provisioned environment.

Not every Unix-like OS comes with bash, and certainly not by default. In particular, Solaris ships with a particularly crippled /bin/sh, although they do have a proper POSIX-compatible Bourne shell at /usr/xpg4/bin/sh.

If your Solaris machines have /bin/bash available, consider yourself very lucky.

dash is portable in the sense that Debian needs it to be: they can port it to the architectures and systems that they need it to work on.

dash is also portable in the sense that you need it to be: it implements the POSIX shell spec and not much more, so it's likely that you have access to all its features when you need to use another shell as well.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.