I have a bash function that produces some output:
function scan { echo \"output\" }
How can I assign this output to a variable?>
I think init_js should use declare instead of local!
function scan3() { declare -n outvar=$1 # -n makes it a nameref. local nl=$'\x0a' outvar="output${nl}${nl}" # two total. quotes preserve newlines }