On 11/28/21 9:13 AM, Léa Gris wrote:
>
> This is ok as here:
>
>> # declare nameref without assigned value
>> declare -n ref
>>
>> # use nameref as iterator
>> for ref in foo bar baz
>> do ref='Hello the World!'
>> done
>>
>> declare -p foo bar baz
>
> although: declare -n ref
> leaves the ref v
This is ok as here:
# declare nameref without assigned value
declare -n ref
# use nameref as iterator
for ref in foo bar baz
do ref='Hello the World!'
done
declare -p foo bar baz
although: declare -n ref
leaves the ref variable in a limbo state with no value
$ unset -n ref; declare -n ref