variable

Bash FUNCNEST

Limits nesting depth for function calls when positive; not a substitute for bounded input and a reachable base case.

Formal Syntax & Structure

bash syntaxbash
FUNCNEST=positive_integer

Return Value

exit status

Limits nesting depth for function calls when positive; not a substitute for bounded input and a reachable base case.

Working Example

Example Snippetbash
FUNCNEST=8f() { local n=$1; if (( n == 0 )); then printf '%s\n' done; else f "$((n-1))"; fi; }f 3
Bash Reference