unset - Unset values of variables and functions

Synopsis

unset [ -fv ] [ name ... ]

Description

You can use unset to unset each variable or function specified by name. If no option is specified, name refers to a variable. Variables with the read-only attribute cannot be unset.

Options

-f
name refers to a function.
-v
name refers to a variable.

Operands

Each name is a variable or function.

Exit Status

Related information

Examples
  1. Unset the variable alpha: unset alpha
  2. Unset the function foo: unset -f foo