On 02/12/2018 09:06 AM, Clark Wang wrote:
On Mon, Feb 12, 2018 at 2:45 PM, Nikolai Kondrashov <[email protected] <mailto:[email protected]>> wrote:On 02/12/2018 08:41 AM, Nikolai Kondrashov wrote: inner() { unset res Oh, and duplicating this line fixes the issue. Take a look at these links: - http://wiki.bash-hackers.org/commands/builtin/unset - http://www.fvue.nl/wiki/Bash:_Passing_variables_by_reference
Thanks, Clark! However, I find it difficult to follow the explanation at the first link and even more difficult to connect it to this case. So I'm not sure I'm getting it right. Could you maybe explain what exactly happens in the code I posted? Regarding the second link, yeah I can see a few ways that the code in question could be improved regarding passing the values from the function, but it's not my code, so I wouldn't like to push for a change unless the problem is indeed with the code and not with Bash. Thank you. Nick
