SyntaxFix
Write A Post
Hire A Developer
Questions
You could use a global variable:
declare globalvar='some string' string () { eval "$1='some other string'" } # ---------- end of function string ---------- string globalvar echo "'${globalvar}'"
This gives
'some other string'