A while a go I looked at Bash replacements for interactive shells. Unfortunately for me, I am just getting too used to having Bash on the command line and can’t get myself used to other shells.
However, interactive shell is one thing, and scripting shell is another. If your scripts are compatible with the original bourne shell, then you should try dash instead of that big fat Bash! This morning I just discovered one of my Debian 5 VPS is not having
/bin/sh linked to dash by default, so I “fixed” the problem, and here is the memory consumption result:
$ ps aux | grep /bin/sh root 7473 0.0 0.1 2416 1156 ? S Feb12 0:00 /bin/sh /usr/bin/mysqld_safe
$ ps aux | grep /bin/sh root 15528 0.0 0.0 1632 520 ? S 10:03 0:00 /bin/sh /usr/bin/mysqld_safe
Yup. 1/2 MB reclaimed. Just make sure your
/bin/sh is linked to
dash. If it’s not already the case, then for Debian/Ubuntu based systems
# apt-get install dash # dpkg-reconfigure dash
You also need to make sure all your scripts are compatible with sh/dash (which they ought to anyway).