On Mon, Jun 20, 2016 at 06:42:57PM -0700, L. A. Walsh wrote:
> The local, it seems is sets the local attrib to any future references
> of set/unset. Otherwise, it seems you'd have the situation of
> local Psx_Cor; unset Psx_Cor, where the "unset", counterintuitively,
> would unset the global, and
Chet Ramey wrote:
Think it through. A variable is not set until it has been assigned a
value. Giving a variable an attribute (in this case, the `local'
attribute) without assigning a value means that the variable is still
unset. For example,
Unless it was set in the global cont
Linda, I think the second example is more clear if made more explicit, like:
set -o posix
f() { local POSIXLY_CORRECT; unset POSIXLY_CORRECT; shopt -p -o posix; }
f
On 6/18/16 7:59 PM, Linda Walsh wrote:
> Grisha Levit wrote:
>> The manual references these values being set, not just declared, so maybe
>> should check for invisible_p?
> ---
> Why? I.e. what were you wanting to happen?
Think it through. A variable is not set until it has been assigned a
valu
Grisha Levit wrote:
The manual references these values being set, not just declared, so
maybe should check for invisible_p?
---
Why? I.e. what were you wanting to happen?
Noticeable for example because this works:
$ set +o posix; f() { local POSIXLY_CORRECT=; shopt -p -o posix; }; f;
The manual references these values being set, not just declared, so maybe
should check for invisible_p?
Noticeable for example because this works:
$ set +o posix; f() { local POSIXLY_CORRECT=; shopt -p -o posix; }; f;
shopt -p -o posix
set -o posix
set +o posix
But the opposite does not:
$ set