bug-bash
[Top][All Lists]
Advanced

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

Re: Some Special Array Variables Only Kind Of Initialized


From: John R. Graham
Subject: Re: Some Special Array Variables Only Kind Of Initialized
Date: Sun, 12 Jan 2014 09:15:03 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0


On 01/11/2014 06:18 PM, Chet Ramey wrote:
You don't want the value generated in all cases.  This has an effect on
some variables: RANDOM, for example.  I believe the current behavior is
preferable.

I guess I don't understand why returning stale values for the dynamic variables
under any circumstances would be preferable (or why returning a different value
for RANDOM is in any way a problem), unless the behavior of the set built-in
was explicitly supposed to be a snapshot of the last fetched values. The
behavior certainly surprised me as my GROUPS were reported to be empty.

Now, that all said, this is obviously an extreme corner case. Programatically,
any time the value of a dynamic variable is needed, it'll be referenced through
parameter expansion--and fetched appropriately. Thanks for your time and 
insight.




reply via email to

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