Table of Contents

Bash - Caller - Stack Trace (Builtin command)

About

Caller is a builtin command that returns the context (localization) of any active subroutine call (a shell function or a script executed with the . or source builtins.

Syntax

caller [expr] 

Without expr

Without expr, caller displays the line number and source filename of the current subroutine call.

With expr

If a non-negative integer is supplied as expr, caller displays:

This extra information may be used, for example, to print a stack trace.