On 11/27/12 7:37 PM, Tim Friske wrote:
> If sourced at least twice from another script I get the following output
> printed:
>
> AAA
> BBB
> declare -A ONCE='()'
> CCC
> declare -A ONCE='([std.bash]="1" )'
> BBB
> declare -Ai ONCE='()'
> CCC
> declare -Ai ONCE='([std.bash]="1" )'
>
> If I remove the initialization "=()" from "declare -gAi ONCE" I get the
> following output printed:
>
> AAA
> BBB
> declare -Ai ONCE='()'
> CCC
> declare -Ai ONCE='([std.bash]="1" )'
> BBB
> declare -Ai ONCE='([std.bash]="1" )'
>
> The "declare -gAi ONCE=()" seems to get executed every time although
> surrounded by "[[ ! -v ONCE ]]" whereas "echo AAA" within the same if-block
> only the first time.
>
> Is this a bug or feature?
This is the same bug I described earlier today, with the same fix.
Chet
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU [email protected] http://cnswww.cns.cwru.edu/~chet/