I'm trying to figure out if there's a standard way (not a hack that works) to know the name of the function that is being executed currently on a POSIX shell script. I know I can return the name of the script with $0
. How to apply something similar to functions?
A quick search of the latest POSIX standard indicates no, but:
$LINENO
is a POSIX feature.$0
), because it's not read only and it's not set by some shells.set -o xtrace
.