bug-bash
[Top][All Lists]
Advanced

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

Re: unset does not act as expected on namerefs


From: Geir Hauge
Subject: Re: unset does not act as expected on namerefs
Date: Tue, 26 May 2015 18:05:18 +0200
User-agent: Mutt/1.5.23 (2014-03-12)

On Tue, May 26, 2015 at 11:00:45AM -0500, Eduardo A. Bustamante López wrote:
> # Here we 'unset ref', which actually unsets 'var'. Then, we assign 'var' to
> # 'ref', but since 'ref' is still a nameref, it instead assigns 'var' to 
> 'var'.
> address@hidden:~$ unset ref; ref=var; echo "$ref"; declare -p ref
> var
> declare -n ref="var"
> address@hidden:~$ declare -p var
> declare -- var="var"

Ah, that explains it! Mystery solved, and no longer surprising behavior.

-- 
Geir Hauge



reply via email to

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