dynamic scoping

Bash's rule that a function can see the local variables of whichever function called it, not only globals.

In more detail

If report declares local i and then calls retry, retry sees and can change report's i unless it declares its own local i. Most programming languages use lexical scoping instead, so this surprises people coming from them.

Related terms

Taught in

References