caller in Mac OS X
By: Strauss K Printer Friendly Format
Return the context of any active subroutine call (a shell function or a script) executed with the . or source builtins.
Syntax caller [expr]
Without expr, caller displays the line number and source filename of the current subroutine call. If a non-negative integer is supplied as expr, caller displays the line number, subroutine name, and source file corresponding to that position in the current execution call stack. This extra information may be used, for example, to print a stack trace.
The current frame is frame 0.
The return value is 0 unless the shell is not executing a subroutine call or expr does not correspond to a valid position in the call stack.
Example
$ caller
caller is a builtin command
Most Viewed Articles (in macos ) |
Latest Articles (in macos) |
Comment on this tutorial
- Data Science
- Android
- AJAX
- ASP.net
- C
- C++
- C#
- Cocoa
- Cloud Computing
- HTML5
- Java
- Javascript
- JSF
- JSP
- J2ME
- Java Beans
- EJB
- JDBC
- Linux
- Mac OS X
- iPhone
- MySQL
- Office 365
- Perl
- PHP
- Python
- Ruby
- VB.net
- Hibernate
- Struts
- SAP
- Trends
- Tech Reviews
- WebServices
- XML
- Certification
- Interview