Sharuzzaman Ahmat Raslan a écrit : > > Somehow, the backtick for foo() execute the function, echoing the correct > output, but fails to set the variable $gang to the correct value.
The variable is set, but in a different sub shell. backticks fork a sub shell. By the way $( ) is preferred to backticks, see FAQs