unset command

Used to remove the definition of a variable from the environment. To do so, type unset followed by the variable name
$x=100
$echo $x
100
$unset x
$echo $x

$
Variables IFS, PATH, PS1 and PS2 cannot be unset.
unset can also be used to remove the definitions of the functions.

 

Leave a comment