This is an old revision of the document!


The unset builtin command

unset [-f] [-v] [NAME...]

The unset builtin command is used to unset values and attributes of shell variables and functions. Without any option, unset tries to unset a variable first, then a function.

Options

Option Description
-f treats each NAME as a function name
-v treats each NAME as a variable name

Return status

Status Reason
0 no error
!=0 invalid option
!=0 invalid combination of options (-v and -f)
!=0 a given NAME is read-only

unset -v EDITOR

unset -f myfunc1 myfunc2

You could leave a comment if you were logged in.