If I have a Bash script like:
#!/bin/bash f() { # echo function name, \"f\" in this case }
Is there any way to do this? This could be us
Another example:
# in a file "foobar" foo() { echo "$FUNCNAME fuction begins" } foobar() { echo "$FUNCNAME fuction begins" } echo 'begin main' foo foobar echo 'end main'
Will output:
begin main foo fuction begins foobar fuction begins end main