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.