Summary: | app-shells/bash: 'compgen -v' includes variables that are global-set but local-unset | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Michał Górny <mgorny> |
Component: | Current packages | Assignee: | Gentoo's Team for Core System packages <base-system> |
Status: | RESOLVED CANTFIX | ||
Severity: | normal | CC: | kfm |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- |
Description
Michał Górny
2015-11-15 23:07:35 UTC
This was raised on the bug-bash list in 2017 but Chet is not amenable to the notion of changing this behaviour, and it appears unlikely that he ever will be. See https://www.mail-archive.com/bug-bash@gnu.org/msg19438.html in particular. Somewhat related is that bash-5.0 added the "localvar_unset" option, which prevents unset from popping the value from an outer scope. # bash -c 'x=0; f1() { local x=1; f2; x=2; }; f2() { unset x; declare -p x; }; f1; declare -p x' declare -- x="0" declare -- x="2" $ bash -O localvar_unset -c 'x=0; f1() { local x=1; f2; x=2; }; f2() { unset x; declare -p x; }; f1; declare -p x' declare -- x declare -- x="0" I suppose that makes this CANTFIX. Coincidentally, https://lists.gnu.org/archive/html/bug-bash/2022-07/msg00134.html was posted today. (In reply to Kerin Millar from comment #2) > Coincidentally, > https://lists.gnu.org/archive/html/bug-bash/2022-07/msg00134.html was posted > today. I was wondering if you commented because of this or not :) (In reply to Sam James from comment #3) > (In reply to Kerin Millar from comment #2) > > Coincidentally, > > https://lists.gnu.org/archive/html/bug-bash/2022-07/msg00134.html was posted > > today. > > I was wondering if you commented because of this or not :) Believe it or not, it was entirely coincidental! Notwithstanding, I did just reply in the thread. |