local

Define local variables within the function.

Summary

local [-aAfFgilnrtux] [-p] [name[=value] ...]

The main purpose

Options

The options of the local command are the same as those of the declare command. Please refer to the options of the declare command.

Parameters

name (optional): variable name or defined function name.

value (optional): The value of the variable.

return value

local returns true unless you provide an illegal option, an assignment error, or use the local command outside a function.

example

For related examples, please refer to the declare command.

Incorrect usage

Notice