unset

unset [ -fmv ] name ...

Each named parameter is unset . Local parameters remain local even if unset; they appear unset within scope, but the previous value will still reappear when the scope ends. Individual elements of associative array parameters may be unset by using subscript syntax on name , which should be quoted (or the entire command prefixed with noglob ) to protect the subscript from filename generation.

Option Description

-f

Equivalent to unfunction .

-m

The arguments are taken as patterns (should be quoted) and all parameters with matching names are unset. Note that this cannot be used when unsetting associative array elements, as the subscript will be treated as part of the pattern.

-v

Specifies that name refers to parameters. This is the default behaviour.