snippetbashTip
caller — Print function context. More information: <https://www.gnu.org/software/bash/manual/bash.html#index-
Viewed 0 times
commandfunctioncliprintcallerinformationmorecontext
Problem
How to use the
caller command: Print function context. More information: <https://www.gnu.org/software/bash/manual/bash.html#index-caller>.Solution
caller — Print function context. More information: <https://www.gnu.org/software/bash/manual/bash.html#index-caller>.Print the line and filename where the current function was called:
callerPrint the line, function, and filename where the current function was called:
caller 0Print the line, the function name, and the filename of a function call
n frames back:caller {{n}}Code Snippets
Print the line and filename where the current function was called
callerPrint the line, function, and filename where the current function was called
caller 0Print the line, the function name, and the filename of a function call `n` frames back
caller {{n}}Context
tldr-pages: common/caller
Revisions (0)
No revisions yet.