Hitachi

JP1 Version 11 JP1/Advanced Shell Description, User's Guide, Reference, and Operator's Guide 


9.3.33 unset command (unsets variable values and attributes)

Syntax

unset  [-f] name [ name ...]

Description

This command unsets specified variables or functions. You can specify more than one variable or function name. When you execute the command with the -f option specified, each name is assumed to be a function name, and the specified function definitions are removed.

Arguments

-f

Specifies that this command applies to removal of function definitions.

name

Specifies the name of a variable or function that is to be removed. You can also specify the name of an array.

If an array name is specified for name, all elements constituting the array are unset. To unset only a single element, you must specify for name, "array-name [element number] [element number]" or "array-name [element-number]".

You can specify the numerical value indicating the array element number, @, and * for the array element number. For the range of unset targets with a combination of specifications, see (3) Referencing the values of arrays.

If the read-only attribute is set for a variable whose name is specified, the command terminates with an error. When you execute this command with an undefined variable name or function name specified in name, it terminates with an error.

Return codes

Return code

Meaning

0

Normal termination

1

Error termination (such as that a name specified in name is not defined as a variable or function)

Notes

Examples