Bash trap on exit from function : <p>Is there possible in bash to call some command when function exits. I mean something like:</p>

<pre><code>function foo
{
    # something like this maybe?
    trap "echo \"exit function foo\"" EXIT

    # do something
}

foo
</code></pre>

<p>And i want exit function foo to be printed out.</p>
