Re: 'local -x VARIABLE' does not clear variable for subprocesses

2016-01-27 Thread Michał Górny
Hello, On Tue, 06 May 2014 10:47:45 -0400 Chet Ramey wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > On 5/5/14, 5:27 PM, Arfrever Frehtes Taifersar Arahesis wrote: > > 2014-05-05 22:12 Chet Ramey napisa?(a): > >>> Ability to locally unset a variable also for subprocesses would be

Re: 'local -x VARIABLE' does not clear variable for subprocesses

2014-05-07 Thread Chet Ramey
On 5/7/14, 11:43 AM, Dan Douglas wrote: > On Wednesday, May 07, 2014 10:04:11 AM Chet Ramey wrote: >> On 5/7/14, 2:10 AM, Dan Douglas wrote: >>> By "doesn't shadow" you mean that it _does_ hide the global right? >>> Localizing >>> a variable should cover up globals and variables in parent scopes e

Re: 'local -x VARIABLE' does not clear variable for subprocesses

2014-05-07 Thread Dan Douglas
On Wednesday, May 07, 2014 10:04:11 AM Chet Ramey wrote: > On 5/7/14, 2:10 AM, Dan Douglas wrote: > > By "doesn't shadow" you mean that it _does_ hide the global right? > > Localizing > > a variable should cover up globals and variables in parent scopes even if > > they > > aren't given a value.

Re: 'local -x VARIABLE' does not clear variable for subprocesses

2014-05-07 Thread Chet Ramey
On 5/7/14, 2:10 AM, Dan Douglas wrote: > On Monday, May 05, 2014 11:18:50 AM Chet Ramey wrote: >> The idea behind the bash-4.3 behavior is that the placeholder local >> variable isn't set, and doesn't really exist. It doesn't shadow a >> global variable with the same name until it gets a value. T

Re: 'local -x VARIABLE' does not clear variable for subprocesses

2014-05-06 Thread Dan Douglas
On Monday, May 05, 2014 11:18:50 AM Chet Ramey wrote: > The idea behind the bash-4.3 behavior is that the placeholder local > variable isn't set, and doesn't really exist. It doesn't shadow a > global variable with the same name until it gets a value. The bash-4.2 > behavior was inconsistent: var

Re: 'local -x VARIABLE' does not clear variable for subprocesses

2014-05-06 Thread Chet Ramey
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 5/5/14, 5:27 PM, Arfrever Frehtes Taifersar Arahesis wrote: > 2014-05-05 22:12 Chet Ramey napisa?(a): >>> Ability to locally unset a variable also for subprocesses would be >>> preferable solution. >> >> OK. I'm not sure exactly what this means.

Re: 'local -x VARIABLE' does not clear variable for subprocesses

2014-05-05 Thread Linda Walsh
Chet Ramey wrote: Yes. Once you assign a value to the local instances of the variables, they are set. Local variables inherit the exported status of the variable they are shadowing to avoid surprises in the export environment. Believe it or not, it's less surprising than letting a local varia

Re: 'local -x VARIABLE' does not clear variable for subprocesses

2014-05-05 Thread Arfrever Frehtes Taifersar Arahesis
2014-05-05 22:12 Chet Ramey napisał(a): > > Ability to locally unset a variable also for subprocesses would be > > preferable solution. > > OK. I'm not sure exactly what this means. Can you give me an example? > How would you use this in a situation where `unset' or `declare +x' are > unusable?

Re: 'local -x VARIABLE' does not clear variable for subprocesses

2014-05-05 Thread Chet Ramey
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 5/5/14, 1:13 PM, Arfrever Frehtes Taifersar Arahesis wrote: > Behavior of bash 4.3 is inconsistent between non-subshell subprocesses and > other places: > bash 4.3.11: > > $ export VAR{1,2}=abc > $ f() { local VAR1; local -x VAR2; echo "### Norm

Re: 'local -x VARIABLE' does not clear variable for subprocesses

2014-05-05 Thread Arfrever Frehtes Taifersar Arahesis
2014-05-05 17:18 Chet Ramey napisał(a): > On 5/3/14, 7:22 PM, Arfrever Frehtes Taifersar Arahesis wrote: > > 'local -x VARIABLE' (without assignment of value) does not clear variable > > for subprocesses. > > It is regression in bash 4.3. > > It's not actually a regression; it's a bug fix. It's

Re: 'local -x VARIABLE' does not clear variable for subprocesses

2014-05-05 Thread Chet Ramey
On 5/3/14, 10:59 PM, Linda Walsh wrote: > > > Arfrever Frehtes Taifersar Arahesis wrote: >> bash 4.2.47: >> $ export VAR1=abc VAR2=abc >> $ f() { local VAR1; local -x VAR2; bash -c 'declare -p VAR{1,2}'; } >> $ f >> bash: line 0: declare: VAR1: not found >> bash: line 0: declare: VAR2: not found

Re: 'local -x VARIABLE' does not clear variable for subprocesses

2014-05-05 Thread Chet Ramey
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 5/3/14, 7:22 PM, Arfrever Frehtes Taifersar Arahesis wrote: > 'local -x VARIABLE' (without assignment of value) does not clear variable for > subprocesses. > It is regression in bash 4.3. It's not actually a regression; it's a bug fix. It's worth

Re: 'local -x VARIABLE' does not clear variable for subprocesses

2014-05-04 Thread Dan Douglas
On Sunday, May 04, 2014 01:22:02 AM Arfrever Frehtes Taifersar Arahesis wrote: > 'local -x VARIABLE' (without assignment of value) does not clear > variable for subprocesses. It is regression in bash 4.3. > > Behavior of 'local VARIABLE' without -x option also changed, but I am > not sure what sho

Re: 'local -x VARIABLE' does not clear variable for subprocesses

2014-05-03 Thread Linda Walsh
Arfrever Frehtes Taifersar Arahesis wrote: bash 4.2.47: $ export VAR1=abc VAR2=abc $ f() { local VAR1; local -x VAR2; bash -c 'declare -p VAR{1,2}'; } $ f bash: line 0: declare: VAR1: not found bash: line 0: declare: VAR2: not found bash 4.3.11: $ export VAR1=abc VAR2=abc $ f() { local VAR1; l

'local -x VARIABLE' does not clear variable for subprocesses

2014-05-03 Thread Arfrever Frehtes Taifersar Arahesis
'local -x VARIABLE' (without assignment of value) does not clear variable for subprocesses. It is regression in bash 4.3. Behavior of 'local VARIABLE' without -x option also changed, but I am not sure what should be correct behavior in that case. bash 4.2.47: $ export VAR1=abc VAR2=abc $ f() {