bug-bash
[Top][All Lists]
Advanced

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

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


From: Chet Ramey
Subject: Re: 'local -x VARIABLE' does not clear variable for subprocesses
Date: Tue, 06 May 2014 10:47:45 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.5.0

-----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.  Can you give me an example?
>> How would you use this in a situation where `unset' or `declare +x' are
>> unusable?
> 
> I would like to be able to unexport a variable for subprocesses called in 
> given function, but
> not subprocesses called later outside of given function.

OK.  I believe that the bash-4.2 behavior was a bug (and it was, it caused
several reported seg faults with null pointer dereferences and the
aforementioned inconsistent behavior).  What you want is fundamentally at
odds with how the shell is intended to behave. Is it enough to assign
empty values to the local variables?

Chet


- -- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU    chet@case.edu    http://cnswww.cns.cwru.edu/~chet/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (Darwin)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iEYEARECAAYFAlNo9hEACgkQu1hp8GTqdKurTgCeLal2lsToqnko8d653O5Vj+H4
utwAn3eiZdPS5onqMZYRZeyBuf/ABsF2
=IpH6
-----END PGP SIGNATURE-----



reply via email to

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