'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() { 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; local -x VAR2; bash -c 'declare -p VAR{1,2}'; }
$ f
declare -x VAR1="abc"
declare -x VAR2="abc"

--
Arfrever Frehtes Taifersar Arahesis


signature.asc
Description: This is a digitally signed message part.


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; local -x VAR2; bash -c 'declare -p VAR{1,2}'; }
$ f
declare -x VAR1="abc"
declare -x VAR2="abc"

---
   What's especially peculiar is that if you change VAR1+VAR2
in 'f', then the called bash in 'f' should still see the original
value of VAR1 as it was not exported (but it sees both
values as assigned in 'f'.  I.e.

Changing 'f' above to read:
$ f() { local VAR1=1; local -x VAR2=2; bash -c 'declare -p VAR{1,2}'; }
$ f
declare -x VAR1="1"
declare -x VAR2="2"

Note, the exportation of the local value from 'f()'
of 'VAR1' to a child process was also in 4.2.




'help' command adds unnecessary trailing blanks indenting empty lines

2014-05-03 Thread 積丹尼 Dan Jacobson
No big deal but,
$ help :|cat -e
:: :$
Null command.$
$
No effect; the command does nothing.$
$
Exit Status:$
Always succeeds.$