Re: [BUG] persistently assigned variable cannot be unexported in POSIX mode

2018-04-30 Thread Martijn Dekker
Op 30-04-18 om 21:12 schreef Chet Ramey: 2. The bug is: 'declare +x' a.k.a. 'typeset +x' then fails to unexport the variable in the second version above. The variable remains exported past 'typeset +x foo', as proven by grepping the output of 'env'. Now you've just created a local variable (type

Re: [BUG] persistently assigned variable cannot be unexported in POSIX mode

2018-04-30 Thread Chet Ramey
On 4/30/18 2:57 PM, Martijn Dekker wrote: > Op 27-04-18 om 22:16 schreef Chet Ramey: >> On 4/25/18 10:51 PM, Martijn Dekker wrote: >> >>> What I'm reporting here is a bug I discovered with unexporting a variable >>> that is so exported while bash is in POSIX mode. It cannot be unexported >>> using

Re: [BUG] persistently assigned variable cannot be unexported in POSIX mode

2018-04-30 Thread Martijn Dekker
Op 27-04-18 om 22:16 schreef Chet Ramey: On 4/25/18 10:51 PM, Martijn Dekker wrote: What I'm reporting here is a bug I discovered with unexporting a variable that is so exported while bash is in POSIX mode. It cannot be unexported using 'typeset +x' if you try to do that in a shell function. T

Re: [BUG] persistently assigned variable cannot be unexported in POSIX mode

2018-04-27 Thread Chet Ramey
On 4/25/18 10:51 PM, Martijn Dekker wrote: > What I'm reporting here is a bug I discovered with unexporting a variable > that is so exported while bash is in POSIX mode. It cannot be unexported > using 'typeset +x' if you try to do that in a shell function. > > This works: > > $ bash -o posix -c

[BUG] persistently assigned variable cannot be unexported in POSIX mode

2018-04-25 Thread Martijn Dekker
POSIX allows assignments preceding special builtins such as ':', 'set', etc. not only to persist but also to be persistently exported. I think that exporting behaviour is inherently broken and it's unfortunate that bash does this in POSIX mode, as it's merely allowed and not actually mandated,