In Bash, we can set an environment variable for a single command this way:
FOO=bar somecommand
What if we want to unset a variable for a single command?
Technically, they're not environment variables until someone export
s them. But you can at least set them to empty:
FOO= some command
If removing them from the environment is enough, you can use env
:
env -u FOO somecommand