Re: IGNOREEOF and POSIXLY_CORRECT don't ignore invisible vars

2016-06-21 Thread Greg Wooledge
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

Re: IGNOREEOF and POSIXLY_CORRECT don't ignore invisible vars

2016-06-20 Thread L. A. Walsh
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

Re: IGNOREEOF and POSIXLY_CORRECT don't ignore invisible vars

2016-06-20 Thread Grisha Levit
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

Re: IGNOREEOF and POSIXLY_CORRECT don't ignore invisible vars

2016-06-20 Thread Chet Ramey
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

Re: IGNOREEOF and POSIXLY_CORRECT don't ignore invisible vars

2016-06-18 Thread Linda Walsh
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;

IGNOREEOF and POSIXLY_CORRECT don't ignore invisible vars

2016-06-04 Thread Grisha Levit
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