bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Arfrever Frehtes Taifersar Arahesis
Subject: 'local -x VARIABLE' does not clear variable for subprocesses
Date: Sun, 4 May 2014 01:22:02 +0200
User-agent: KMail (GNU/Linux)

'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

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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]