Trace function execution during debugging.
Section: Functions
Trace shell functions
bash
bash
set -x
my_func() { echo ok; }
my_func
set +xExplanation
Useful when debugging control flow and variable expansion.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing Functions
Use local variable in function
Keep function internals from leaking into caller scope.
Return data via stdout
Emit data to stdout and capture it with command substitution.