UNIX scripting tip: guard against bad directory names