|
From: | Grisha Levit |
Subject: | Re: mapfile creates poorly-named array if passed nameref to array subscript |
Date: | Wed, 1 Jun 2016 22:45:58 -0400 |
I guess it’s even more general than just list assignments. See also below problems with declare
:
$ declare -n ref=var[123]; unset ref; declare ref=; declare -p ${!ref}
declare -- var[123]="123]"
$ declare -n ref=var[123]; unset ref; declare ref+=; declare -p ${!ref}
declare -- var[123]="23]"
$ declare -n ref=var[123]; unset ref; declare +t ref; ref=X; declare -p ${!ref}
declare -- var[123]="X"
(The +t
above can be replaced with any other flag)
[Prev in Thread] | Current Thread | [Next in Thread] |