bug-bash
[Top][All Lists]
Advanced

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

Re: mapfile creates poorly-named array if passed nameref to array subscr


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)


reply via email to

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