unsetenv 1 user commands nosh
unsetenv unset an environment variable then chain
`unsetenv` var next-prog

## NOTE

C-shells have a built-in `unsetenv` command that does not chain. See the manual for each individual shell for its built-in command.

## Description

`unsetenv` is a chain-loading utility that unsets the environment variable var and then chain loads to next-prog with the execvp 3 function.

next-prog may contain its own command line options, which `unsetenv` will ignore.

Unsetting a variable is not the same as setting it to an empty value. For that, see setenv 1.

If var contains an equals character, counter-intuitive things will happen to the environment.

## Bugs

As of version 1.34 this program no longer employs the GNU C library nor the BSD C library for environment variable handling. The previously documented workaround for those libraries' having memory leaks in their setenv 3 and clearenv 3 functions, is therefore no longer necessary.

## See also

- clearenv 1

## Author

Jonathan de Boyne Pollard