Functions for safer shell scripting.