var=meow declare -n ref=var echo $ref # prints meow ref=moo echo $var # prints moo
Bash Magic Ref
Creator
Creator
Seonglae ChoCreated
Created
2021 Sep 13 14:48Editor
Editor
Seonglae ChoEdited
Edited
2025 Jun 9 15:53Refs
Refs
Pointer
Seonglae Cho
Seonglae Chovar=meow declare -n ref=var echo $ref # prints meow ref=moo echo $var # prints moo