Re: /bin/bash vs. /bin/sh

Todd Fries (
Mon, 18 Sep 1995 19:20:12 +0000 (GMT)

> This points out a bad habit of *lots* of Linux developers: they (usually
> inadvertently) assume that /bin/sh is really a full version of Bash or
> that features they are accustomed to from Bash are in every Bourne Shell.

I do not dispute this 'bad habit'.

> There are some good reasons not to use a full version of bash as /bin/sh,
> the two most important of which are (1) it is not 100% Bourne-shell
> compatible as normally configured; (2) the added overhead of running a
> much bigger executable for every Bourne shell script; and (3) it results
> in you tending not to realize that your shell scripts are non-portable
> outside of Linux (or even to many Linux machines).

But I do dispute the 'added overhead'.

> I personally found that the smallest, most compatible Bourne shell I could
> make was by taking out all the non-Bourne-shell options from pdksh; I got
> it down to 108 KB (ELF) and it could probably be made smaller. At any
> rate this is much smaller than a minimal version of Bash, though both work
> quite well. Ash, OTOH, is nowhere near compatible with Bourne Shell
> (though it is nice and small). One other bad Bourne Shell clone is SCO's
> /bin/sh, which is very different from sh on any modern UNIX (I would call
> it broken, but maybe it's just antique).

My personal experience has varied greatly from this. I simply compiled bash
shaired, and now I have a 6k executable with a 370k shaired library.
Very acceptable, imho...

Just thought I'd point out that size really doesn't need to be an issue.

For anyone wishing for the elf binary/library,

will allow you to try out what I am talking about.