unset command for bash


unset

Remove variable or function names
Syntax
      unset [-fv] [name]

Options
      -f    The names refer to shell Functions, 
            and the function definition is removed.
            Readonly variables and functions may not be unset. 

      -v    Each name refers to a shell Variable (default)
The return status is zero unless a name does not exist or is readonly.
unset is a bash built in command.

example:

$ MYDEF=3939   #env command will not output MYDEF
$ echo $MYDEF
3939
$ export MYDEF
$ env |grep 'MYDEF'
MYDEF=3939
unset MYDEF     #remove the MYDEF environment variable
$ env |grep 'MYDEF'



"A good trader has to have three things: a chronic inability to accept things at face value, to feel continuously unsettled, and to have humility" - Michael Steinhardt

No comments:

Post a Comment