|
declare
Declare variables and give them attributes.
SYNTAX declare [-afFrxi] [-p] [name[=value]] OPTIONS -a Each name is an array variable. -f Use function names only.
-F Inhibit the display of function definitions; only the function name and attributes are printed. (implies -f) -i The variable is to be treated as an integer; arithmetic evaluation is performed when the variable is assigned a value.
-p Display the attributes and values of each name. When `-p' is used, additional options are ignored. -r Make names readonly. These names cannot then
be assigned values by subsequent assignment statements or unset.
-x Mark each name for export to subsequent commands
via the environment.
If no names are given, then `declare' will display the values of variables instead.
declare
makes each name local,
as with the local
command. typeset
command is supplied for compatibility with the Korn
shell; however, it has been deprecated in favor of the declare
builtin command. Related commands:
alias - Create an alias
env - Display, set, or remove environment variables
echo - Display message on screen
export - Set an environment variable
hostname - Print or set system name
local - Create variables
printenv - Print environment variables
readonly - Mark variables/functions as readonly
shift - Shift positional parameters