local (Bash)

From wikieduonline
Jump to navigation Jump to search

A variable can be assigned the nameref attribute using the -n option to the declare or local builtin commands (see Bash Builtin Commands) to create a nameref, or a reference to another variable. This allows variables to be manipulated indirectly. Whenever the nameref variable is referenced, assigned to, unset, or has its attributes modified (other than using or changing the nameref attribute itself), the operation is actually performed on the variable specified by the nameref variable’s value. A nameref is commonly used within shell functions to refer to a variable whose name is passed as an argument to the function

Related[edit]

See also[edit]

Advertising: