In `bash`, use FUNCNAME array:
tt() {
printf '%s\
' "$FUNCNAME"
}
* * *
With some `ksh` implementations:
tt() { printf '%s\
' "$0"; }
In `ksh93`:
tt() { printf '%s\
' "${.sh.fun}"; }
From `ksh93d` and above, you can also use `$0` inside function to get the function name, but you must define function using `function name { ...; }` form.
* * *
In `zsh`, you can use `funcstack` array:
tt() { print -rl -- $funcstack[1]; }
or `$0` inside function.
* * *
In `fish`:
function tt
printf '%s\
' "$_"
end