recentpopularlog in

kme : traps   1

Bash trap on exit from function - Stack Overflow
Sure enough, it was right there in the docs for 'trap' (and 'return').
Yes, you can trap RETURN :
<code class="language-bash">$ function foo() {
> trap "echo finished" RETURN
> echo "doing some things"
> }</code>
unix  linux  bash  shellscripting  til  traps  solution 
october 2019 by kme

Copy this bookmark:

to read