Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > gnu.bash.bug > #14900 > unrolled thread
| Started by | Grisha Levit <grishalevit@gmail.com> |
|---|---|
| First post | 2018-12-09 01:30 -0500 |
| Last post | 2018-12-09 01:30 -0500 |
| Articles | 1 — 1 participant |
Back to article view | Back to gnu.bash.bug
should `local' create local variables when they exist in the tempenv? Grisha Levit <grishalevit@gmail.com> - 2018-12-09 01:30 -0500
| From | Grisha Levit <grishalevit@gmail.com> |
|---|---|
| Date | 2018-12-09 01:30 -0500 |
| Subject | should `local' create local variables when they exist in the tempenv? |
| Message-ID | <mailman.5422.1544337070.1284.bug-bash@gnu.org> |
When a variable is present in the temporary environment and then declared
local in a function, it seems to not actually make a local variable, in the
sense that the variable does not show up in the output of `local',
unsetting
the variable reveals the variable from the higher scope rather than marking
it invisible, etc.
$ f() { local v=x; local -p; }; v=t f
$ f() { local v; declare -p v; }; v=t f
declare -x v="t"
$ f() { local v=x; unset v; declare -p v; }; v=g; v=t f
declare -- v="g"
Is this intentional?
Back to top | Article view | gnu.bash.bug
csiph-web