Às vezes, basta ler man bash
:
FUNCNAME
An array variable containing the names of all shell functions currently in the execution call stack. The element with index 0 is the name of any currently-executing shell function. The bottom-most element (the one with the highest index) is "main". This variable exists only when a shell function is executing. Assignments to FUNC- NAME have no effect and return an error status. If FUNCNAME is unset, it loses its special properties, even if it is subsequently reset.
Exemplo de uso:
#!/usr/bin/env bash
func()
{
echo I am inside "$FUNCNAME"
}
foo()
{
echo I am inside "$FUNCNAME"
}
func
foo