Is there possible in bash to call some command when function exits. I mean something like:
function foo
{
# something like this maybe?
trap "echo \"exit function foo\"" EXIT
# do something
}
foo
And i want exit function foo to be printed out.