unset
ShellFundamentals In simulator In real LinuxRemove a variable
Name: unset
You can practise it right away in the simulator, and use it in real Linux mode too.
Description
unset is a shell builtin that removes variables (or functions with -f). The variable then no longer exists, which differs from setting it to an empty string; ${var:-default} and [ -v var ] can tell the difference.
Syntax
unset NAME...Common options
| -v | Remove variables (the default) |
| -f | Remove a function |
Examples
$ export TEMP=1 && unset TEMP
Set a variable, then remove it
Explain