[Top][All Lists]

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

Re: declare -ag with assignment bug

From: Chet Ramey
Subject: Re: declare -ag with assignment bug
Date: Thu, 26 Apr 2012 21:44:08 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:11.0) Gecko/20120327 Thunderbird/11.0.1

On 4/26/12 4:50 PM, Joseph Graham wrote:

> Bash Version: 4.2
> Patch Level: 24
> Release Status: release
> Description:
> Arrays defined in a function with declare -ag are not
> available outside the function if an assignment is done with the
> declaration, though it works if the assignment is done seperately from
> the declaration.
> Repeat-By:
> $ f() { declare -ag a=(my array); }; f; declare -p a
> declare -a a='()'
> $ f() { declare -ag a; a=(my array); }; f; declare -p a
> declare -a a='([0]="my" [1]="array")'


``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/

reply via email to

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