Several reasons why debian should not use bash for /bin/sh
I'm new to debian but I'm not new to either unix or linux. I recently
installed debian on my laptop. On my prior linux setup, I had pdksh as
/bin/sh. While I sometimes had problems with scripts, I never ran into
showstoppers. When I made ash or pdksh /bin/sh on my debian setup, things
stopped working. I consider this to be a serious problem with debian.
I can think of many reasons why bash should not be used as /bin/sh:
Size: bash is much larger than any of the simpler Bourne compatible
shells. From cold boot to prompt, I typically have an extra
megabyte or more available memory if I use ash or pdksh instead
of bash.
Speed: bash is much slower than ash or pdksh. From init scripts to
cron or day to day shell scripts, /bin/sh gets run many thousands
of times. Because bash is slower, this results in a slower
feeling machine. For example my computer boots noticeably faster
when I use pdksh or ash instead of bash.
Safety: Bash, at least in the debian installation I've installed, is linked
against 5 libraries (readline, curses, dl, c and ld-linux). If
any one of these libraries gets hosed, /bin/sh stops working and
this effectively kills the system. A smaller, simpler shell would
be less vulnerable to library problems.
Compatibility: People are tempted to (and in fact do) write scripts that
use bash specific extensions when explicitly calling /bin/sh.
On all other unix systems, /bin/sh does not have bash specific
extensions. This means that work that could be useful in other
unixes gets trapped in a linux/debian world because the scripts
stop working. For example, I make my money by taking care of
Solaris 2.x and HP-UX 9/10.x machines. I would love to be able
to use debian packages (if they existed) on my machines. I might
even get my boss to pay money for such things. I will not,
however, change /bin/sh on any system to be bash.
I have heard a number of people here say "ksh is not Bourne shell
compatible". This is nonsense. The Korn shell is not *bash* compatible,
but that does not mean that it is not *borne shell* compatible. Bash,
the posix shell, and ksh all implement a complete Bourne shell environment.
Each has its own enhancements to this Bourne shell environment, which are
not guaranteed to be compatible with the other Bourne shells. /bin/sh is
only ever guaranteed to be a traditional Bourne shell. On some unixes, you
may get the posix shell, which is mostly ksh. On linux machines, you
typically get bash. But on some, you only get traditional Bourne shell.
Any script that needs an extension that is not in traditional Bourne shell
but which calls /bin/sh is buggy and should be fixed.
chris
--
Chris Ulrich cdulrich@ucdavis.edu 530 754 4355
--
Unsubscribe? mail -s unsubscribe debian-user-request@lists.debian.org < /dev/null
Reply to: