mirror of
https://https.git.savannah.gnu.org/git/bash.git
synced 2026-07-10 13:40:55 +02:00
commit bash-20160624 snapshot
This commit is contained in:
+10
-10
@@ -684,12 +684,12 @@ PPAARRAAMMEETTEERRSS
|
||||
and llooccaall below) to create a _n_a_m_e_r_e_f, or a reference to another vari-
|
||||
able. This allows variables to be manipulated indirectly. Whenever
|
||||
the nameref variable is referenced, assigned to, unset, or has its
|
||||
attributes modified (other than the _n_a_m_e_r_e_f 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. For instance, if a variable name is passed to a shell
|
||||
function as its first argument, running
|
||||
attributes modified (other than using or changing the _n_a_m_e_r_e_f 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 argu-
|
||||
ment to the function. For instance, if a variable name is passed to a
|
||||
shell function as its first argument, running
|
||||
declare -n ref=$1
|
||||
inside the function creates a nameref variable rreeff whose value is the
|
||||
variable name passed as the first argument. References and assignments
|
||||
@@ -4427,9 +4427,9 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS
|
||||
--nn Give each _n_a_m_e the _n_a_m_e_r_e_f attribute, making it a name
|
||||
reference to another variable. That other variable is
|
||||
defined by the value of _n_a_m_e. All references, assign-
|
||||
ments, and attribute modifications to _n_a_m_e, except for
|
||||
changing the --nn attribute itself, are performed on the
|
||||
variable referenced by _n_a_m_e's value. The nameref
|
||||
ments, and attribute modifications to _n_a_m_e, except those
|
||||
using or changing the --nn attribute itself, are performed
|
||||
on the variable referenced by _n_a_m_e's value. The nameref
|
||||
attribute cannot be applied to array variables.
|
||||
--rr Make _n_a_m_es readonly. These names cannot then be assigned
|
||||
values by subsequent assignment statements or unset.
|
||||
@@ -5924,4 +5924,4 @@ BBUUGGSS
|
||||
|
||||
|
||||
|
||||
GNU Bash 4.4 2016 April 27 BASH(1)
|
||||
GNU Bash 4.4 2016 May 29 BASH(1)
|
||||
|
||||
Reference in New Issue
Block a user