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 +TReturn 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