unset: unset values and attributes of variables
unset [-v|-f] NAME...
Options you will use
-v- Treat each NAME as a variable (the default).
-f- Treat each NAME as a shell function.
Examples
$ unset AWS_PROFILEremove the variable, so the next command falls back to its default
$ unset -f deployremove a shell function
Gotchas
- unset removes the variable;
VAR=keeps it, set to the empty string.${VAR-default}andset -utell the two apart;${VAR:-default}does not. - An exported variable that is unset is gone from the environment of every command started afterwards.
Taught in
Try unset in a real terminal Free, in your browser - a real Ubuntu terminal to try it in, with missions that check your work.