Fix Broken Scripts In Ubuntu

For some unexplained reason, Ubuntu has decided to take a long time standard and muck with it, thus breaking a number of applications. Have you ever tried to install something on Ubuntu or run an old script, and had an inexplicable error? It may well be caused by the (now infamous) /bin/sh bug.

what they did

In almost every distribution I’ve ever used, the file /bin/sh has been symlinked to /bin/bash. bash is the most common linux command line shell. Because of this, most application developers start their shell scripts with the line:

#!/bin/sh

and they expect that their shell script will run in the bash shell. However, for some reason, Ubuntu has symlinked /bin/sh to /bin/dash. dash is a Debian derived light version of bash, and for some reason, it often breaks scripts that expet the bash shell. Scripts often break.

how to fix this

Simply change the symlink so that it points to /bin/bash. To do this, open a terminal, and type the following:

sudo rm -f /bin/sh
sudo ln -s /bin/bash /bin/sh

From now on your scripts should work as their authors expected.