LOCAL(1)

NAME

local - declare variables local to the current function invocation.

SYNOPSIS

local [-airx] [name[=value] ...]

DESCRIPTION

local declares variables local to the current function invocation. It may only be used while a shell function is running. With no operands, it succeeds without changing state.

Each operand must be a valid shell variable name, assignment, or indexed-array assignment. If a name is declared without an explicit value, Rush initializes the local from a matching assignment prefix when one is present; otherwise the local starts unset.

OPTIONS

-a
Declare an indexed array.
-i
Apply the integer attribute and evaluate assignment values arithmetically.
-r
Apply the readonly attribute.
-x
Apply the export attribute.
--
End option parsing.

EXIT STATUS

Zero on success, one when used outside a function or when a declaration fails, and two for invalid options.

SEE ALSO

rush-builtins(7), declare(1).