Unset an environment variable for a single command
env -u FOO somecommand
This will remove the environment variable FOO
from the somecommand
process' environment.
And to unset multiple variables:
env -u FOO -u FOO2 somecommand
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