Replacing Big Fat Bash with Dash for Scripting
Mar 15, 2009 @ 11:15 pm
/
/
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:
Before
$ ps aux | grep /bin/sh
root 7473 0.0 0.1 2416 1156 ? S Feb12 0:00 /bin/sh /usr/bin/mysqld_safe
After
$ 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).

LEA (LowEndAdmin) is the original founder of LowEndBox and the visionary who gave rise to an entire movement around minimalist, efficient hosting. In 2008, LEA launched LowEndBox with a simple but powerful idea: that it was possible to run meaningful applications, web servers, VPNs, mail servers, and more – on small, low-cost virtual machines with minimal resources.
At a time when most infrastructure discussions were dominated by high-end servers and enterprise platforms, LEA championed the opposite approach: lightweight Linux distros, self-managed servers, open source software, and thoughtful optimization. This philosophy gave birth to the term “Low End Box”, which would come to define a new genre of hosting tailored to developers, tinkerers, and budget-conscious users around the world.
Through LowEndBox and its companion forum, LowEndTalk, LEA built the foundation for what would become one of the most active and enduring communities in the hosting world, prioritizing knowledge-sharing, transparency, and accessibility.
After several years of nurturing the site and community, LEA stepped away from active involvement, passing the torch to a new generation of admins, contributors, and moderators. Today, LEA remains a respected figure in the LowEnd ecosystem, credited with launching a platform and philosophy that continues to influence thousands of infrastructure providers and users globally.
LowEndBox’s legacy, and its thriving community, is a direct result of LEA’s original vision.
I know this is almost four years late, but take a look at
mksh
as well. It’s a Debian Squeeze replacement ofpdksh
and it includes a statically-linked binary calledmksh-static
(/bin/mksh-static
) that is trimmed down a bit. It can be used both as an interactive and non-interactive shell and takes just ~200 KB memory on my VPS.I also set
mksh-static
instead ofbash
for my SSH session and that saved me whole 2 megabytes.