greycat 1437077834 learn "declare -n" looks like a great idea but it doesn't work. See http://mywiki.wooledge.org/BashFAQ/048 (under "The problem with bash's name references"). greycat 1572902617 forget greycat 1572902618 learn "declare -n" tries to create a name reference to a variable. It's severely flawed: the variable is resolved by looking for a matching name using dynamic scope. See https://mywiki.wooledge.org/BashProgramming#Functions and FAQ 48.