set-option

functrace

Inherit DEBUG and RETURN traps in functions, command substitutions and subshell environments; use bounded trusted traces.

Formal Syntax & Structure

bash syntaxbash
set -T; set +T

Return Value

shell option

Inherit DEBUG and RETURN traps in functions, command substitutions and subshell environments; use bounded trusted traces.

Working Example

Example Snippetbash
work() { printf 'work\n'; }trap 'printf "returned\n" >&2' RETURNset +Tworkset -Tworktrap - RETURNwork
Bash Reference