Useful bits of shell scripting