Yikes, I missed the exec command in my example, that would certainly make
it confusing..

What I meant was that the assignment works (i.e. the nameref is followed
correctly), but the relevant code
<http://git.savannah.gnu.org/cgit/bash.git/tree/redir.c?h=devel#n1368>
doesn’t handle retrieving the value of such a nameref when it needs to do
so to close the descriptor:

$ declare -n ref=var[0]
$ exec {ref}</dev/null
$ declare -p vardeclare -a var=([0]="10")
$ exec {ref}<&-
bash: ref: ambiguous redirect

​

Reply via email to