value]] typeset [
Declare variables and manage their attributes. In function bodies, variables are local, as if declared with the local command.
Each name is an indexed array variable.
Each name is an associative array variable.
Each name is a function.
For functions, print just the function name and attributes, not the function definition (body). Implies -f.
Each variable is an integer; in an assignment, the value is evaluated as an arithmetic expression.
Assign all values as lowercase only; convert uppercase to lowercase.
With no names, print all variables and their values. With names, print the names, attributes, and values of the given variables. Used with -f, print all function names and attributes. This option causes all other options to be ignored.
Mark names as read-only. Subsequent assignments will fail.
Apply the trace attribute to each name. Traced functions inherit the DEBUG and RETURN traps from the shell. This attribute has no meaning for variables.
Assign all values as uppercase only; convert lowercase to uppercase.
Mark names for export into the environment of child processes.
With a + instead of a -, the given attribute is disabled. With no variable names, all variables having the given attribute(s) are printed in a form that can be reread as input to the shell.
declare -i valMake val an integer $
val=4+7Evaluate value $
echo $valShow result 11 $
declare -r z=42Make ...