Low End Box

Hosting Websites on Bare Minimum VPS/Dedicated Servers

Replacing Big Fat Bash with Dash for Scripting

Tags: , Date/Time: March 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).

No Comments

No comments yet.

RSS feed for comments on this post. TrackBack URL

Leave a comment

Some notes on commenting on LowEndBox:

  • Do not use LowEndBox for support issues. Go to your hosting provider and issue a ticket there. Coming here saying "my VPS is down, what do I do?!" will only have your comments removed.
  • Akismet is used for spam detection. Quoting webhostingtalk.com URL seems to get binned consistently here, but I do peek into the spam box frequently to publish those comments.