Bash does have `typeset -n` (from ksh) which allows shell variables to be passed to a function by reference.
Re:Bash functions are better than I thought
by cryptonector on Sunday October 31, 2021 @10:55PM
(#29062624)
Yes, and which gets you Tcl-ish pass by name semantics.
Re:Bash functions are better than I thought
by tomjakubowski on Tuesday November 02, 2021 @09:54PM
(#29090218)
Cool, thanks!
Huh. How does one return a value from a bash function? I've always only ever seen the "echo calling convention" used in scripts, or use of global variables.