Replace debug variable with shell function.