Update set man page to clarify scoping rules

"When an exported variable goes out of scope, it is unexported."

As requested in #5064
This commit is contained in:
ridiculousfish 2018-06-23 15:18:38 -07:00
parent 44bae29039
commit e812b609f9

View file

@ -55,7 +55,7 @@ If the variable name is one or more array elements, such as `PATH[1 3 7]`, only
The scoping rules when creating or updating a variable are: The scoping rules when creating or updating a variable are:
-# If a variable is explicitly set to either universal, global or local, that setting will be honored. If a variable of the same name exists in a different scope, that variable will not be changed. -# Variables may be explicitly set to universal, global or local. Variables with the same name in different scopes will not be changed.
-# If a variable is not explicitly set to be either universal, global or local, but has been previously defined, the previous variable scope is used. -# If a variable is not explicitly set to be either universal, global or local, but has been previously defined, the previous variable scope is used.
@ -64,7 +64,7 @@ The scoping rules when creating or updating a variable are:
The exporting rules when creating or updating a variable are identical to the scoping rules for variables: The exporting rules when creating or updating a variable are identical to the scoping rules for variables:
-# If a variable is explicitly set to either be exported or not exported, that setting will be honored. -# Variables may be explicitly set to either exported or not exported. When an exported variable goes out of scope, it is unexported.
-# If a variable is not explicitly set to be exported or not exported, but has been previously defined, the previous exporting rule for the variable is kept. -# If a variable is not explicitly set to be exported or not exported, but has been previously defined, the previous exporting rule for the variable is kept.