i want function caller name in shell script sometime, in bash works ${funcname[1]}
${funcname[1]} (caller name)
${funcname[0]} c (current name)
but not work in zsh
ie want know function call me in function c
function a(){ c } function b(){ c } function c(){ #if call me; then... #if b call me; then... }
the function call stack in variable $funcstack[].
$ f(){echo $funcstack[1];} $ f f
Comments
Post a Comment