work in $TMP env variable, if provided