help-bash
[Top][All Lists]
Advanced

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

Re: [Help-bash] declare -g -a array doing different things


From: Chet Ramey
Subject: Re: [Help-bash] declare -g -a array doing different things
Date: Sun, 01 Apr 2012 12:53:49 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2

On 3/30/12 11:15 PM, Bill Gradwohl wrote:
> Below please find two almost identical scripts - version1 & version2 and
> their output.
> 
> Here is a diff report :
> address@hidden ycc# diff version*
> 5c5,6
> < declare -g -a array=(function)
> ---
>> declare -g -a array
>> array=(function)
> 
> 
> Why the different output?

It's a bug.  The combination of declare -g and the compound array
assignment was the issue.  See if the attached patch fixes the problem.

Chet
-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU    address@hidden    http://cnswww.cns.cwru.edu/~chet/

Attachment: global-compound-assign.patch
Description: Text Data


reply via email to

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