Report question

Question: Is there a way to execute a command on exit (regardless of how the script exited)?