Bash namerefs for dynamic variable referencing

from blog Redowan's Reflections, | ↗ original
While going through a script at work today, I came across Bash’s nameref feature. It uses declare -n ref="$1" to set up a variable that allows you to reference another variable by name—kind of like pass-by-reference in C. I’m pretty sure I’ve seen it before but probably just skimmed over it. But as I dug into the man page1, I realized there’s a...