Home Articles Dial On Demand with WVDial Writing Robust Bash Shell Scripts PostgreSQL User Administration Network Troubleshooting Becoming a X.509 Certificate Authority Automatic Proxy Configuration with WPAD LDAP Basics Bash Prompts David Pashley.com Writing Robust Bash Shell Scripts Many people hack together shell scripts quickly to do simple tasks, but these soon take on a life of their own. Unfortunately shell scripts are full of subtle effects which result in scripts failing in unusual ways. It’s possible to write scripts which minimise these problems. In this article, I explain several techniques for writing robust bash scripts. How often have you written a script that broke because a variable wasn’t set? I know I have, many times. chroot=$1 ... rm -rf $chroot/usr/share/doc If you ran the script above and accidentally forgot to give a parameter, ...