http://stackoverflow.com/questions/307503/whats-the-best-way-to-check-that-environment-variables-are-set-in-unix-shellscr [ -z "$STATE" ] && echo "Need to set STATE" && exit 1; What’s the best way to check that environment variables are set in Unix shellscript