Re: declare in a function makes a variable unable to be found with decla
From:
Chet Ramey
Subject:
Re: declare in a function makes a variable unable to be found with declare -p in some cases
Date:
Thu, 19 Feb 2015 15:17:47 -0500
User-agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.2.0
On 2/17/15 5:46 PM, Eduardo A. Bustamante López wrote:
> You're reporting the behavior of the master branch, but it seems to
> be already fixed in devel. I'm not sure about the inconsistency
> between:
> | "$bash" -c 'declare -a a="()"; declare -p a'
> and
> | "$bash" -c 'f(){ declare -a a="()"; declare -p a; }; f'
>
> IMO these two should have the same behaviour. Chet will be able to
> clarify this.
Thanks for the prompt; this is something that was waiting for me to bump
the version number and use a check for the shell compatibility level.
It will be fixed in the next git push for the devel branch.
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/