Use function-local scope for shell variable in SHELL_FUNCTION template.