declare [ -Eilrux ] name [=value] ...
declare [ +Eilrux ] name [=value] ...
declare -fF [ name ... ]
declare -p name ...
declare
Description
The declare utility declares variables, assigns values to variables, sets or unsets attributes for variables, and displays the definitions for shell functions. If used in a shell function, declare makes the variable name local to the function.
In the first synopsis form, declare declares a variable name and optionally assigns it the specified value. If an option is specified, the corresponding attribute is turned on for the variable.
In the second synopsis form, declare declares a variable name and optionally assigns it the specified value. If an option is specified, the corresponding attribute is turned off for the variable.
In the third synopsis form, declare displays the names and definitions for all shell functions if no names are specified or the shell functions specified by name.
In the fourth synopsis form, declare displays the attributes and value of the variables specified by name in a re-enterable format.
In the fifth synopsis form, declare displays the names and values of all variables.
Options
Operands
Each name must be a valid shell variable name.
Exit Status
Related information