make sure a sane umask is set for bash env file creation
use consistent variable name for umasks
use $() instead of backticks