Bash: Only set environment variables if nessicary