On +2015/05/26 18:05:18, Geir Hauge wrote: > 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'. > > dualbus@hp:~$ unset ref; ref=var; echo "$ref"; declare -p ref > > var > > declare -n ref="var" > > dualbus@hp:~$ declare -p var > > declare -- var="var" > > Ah, that explains it! Mystery solved, and no longer surprising behavior. >
If there's no good reason to keep this as is (some use case where this might be wanted and breaking backward compatibility - I can't see anyone actually *wanting* it this way) shouldn't it be changed? A behavior can be documented and still be bad.
pgpOwZAk14bLp.pgp
Description: PGP signature