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

  1. This command is a built-in bash command. For related help information, please check the help command and the corresponding parts of man bash and info bash.

继续阅读

接下来你可能需要这些内容

优先推荐相关内容,同时保留你的阅读轨迹和收藏入口。