sanitize output of getenv