caller caller [expr]
Returns the context of any active subroutine call (a shell function or a script executed with the . or source builtins).
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. command command [-pVv] command [arguments ...]
Runs command with arguments ignoring any shell function named command.
Only shell builtin commands or commands found by searching the PATH are executed. If there is a shell function named ls, running ‘command ls’ within the function will execute the external command ls instead of calling the func- tion recursively. The -p option means to use a default value for PATH that is guaranteed to find all of the standard utilities. The return status in this case is 127 if command cannot be found or an error occurred, and the exit status of command otherwise.
If either the -V or -v option is supplied, a description of command is printed.
The -v option causes a single word indicating the command or file name used to invoke command to be displayed; the -V option produces a more verbose description. In this case, the return status is zero if command is found, and non-zero if not. declare declare [-aAfFgilnrtux] [-p] [name[=value] ...]
Declare variables and give them attributes. If no names are given, then display the values of variables instead.
The -p option will display the attributes and values of each name. When -p is used with name arguments, additional options, other than -f and -F, are ignored.
When -p is supplied without name arguments, declare will display the at- tributes and values of all variables having the attributes specified by the addi- tional options. If no other options are supplied with -p, declare will display the attributes and values of all shell variables. The -f option will restrict the display to shell functions.
The -F option inhibits the display of function definitions; only the function name and attributes are printed. If the extdebug shell option is enabled using shopt (see Section 4.3.2 [The Shopt Builtin], page 62), the source file name and line number where the function is defined are displayed as well. -F implies -f.