Archive for the 'Better Scripts' Category

Better Scripts #3 - use logger

When you write scripts, especially scripts that will be executed unattended by cron or a similar facility, in most cases you want some way of getting error messages. Sometimes email is the way to go, sometimes you can just redirect output to a text file. Solaris and most other *NIX operating systems are shipped with […]

Better Scripts #2 - Don’t use bash

If you want to cause a controversy on mailing lists go ahead and ask a question about which shell you should use. There are a million different opinions about this even though there is not that many shells available.
However, when you want to write portable scripts please don’t use bash but use ksh (or even […]

Better Scripts #1

Oops! You just sent the root password for your central MySQL server to a big mailing list. You scramble to change it as fast as possible. Sometimes you may need to include a password or some other important information in cleartext in a script. A database backup script could be a good example. You whip […]