Content
Data
License: GNU GPLv3 +
Version number: GNU Bash 5
Developer / owner: Free Software Foundation Inc.
Short description:
The manual page and help for the local built-in Bash command. Use the local command to create local variables to which values can be added. Local variables can only be used within a function, not visible outside the function that defines them and its children.
Man page output
man bash
[...]
local [option] [name[=value] ... | - ]
For each argument, a local variable named name is created, and assigned value. The
option can be any of the options accepted by declare. When local is used within a
function, it causes the variable name to have a visible scope restricted to that
function and its children. If name is -, the set of shell options is made local to
the function in which local is invoked: shell options changed using the set builtin
inside the function are restored to their original values when the function re-
turns. With no operands, local writes a list of local variables to the standard
output. It is an error to use local when not within a function. The return status
is 0 unless local is used outside a function, an invalid name is supplied, or name
is a readonly variable.
[...]
Help output
local --help
local: local [kapcsoló] név[=érték] ...
Helyi változók definiálása.
Egy NÉV nevű helyi változót hoz létre, és ÉRTÉK értéket ad neki.
A KAPCSOLÓ tetszőleges, a „declare” által elfogadott kapcsoló lehet.
A helyi változók csak a függvényen belül használhatóak, nem láthatóak
az őket definiáló függvényen és annak gyermekein kívül.
Kilépési kód:
Sikerrel tér vissza, kivéve ha érvénytelen kapcsolót kap, értékadási
hiba történik, vagy nem függvényben lett hívva.
Related Content
- 18 views