How do I kill background processes / jobs when my shell script exits?

I am looking for a way to clean up the mess when my top-level script exits.

Especially if I want to use set -e, I wish the background process would die when the script exits.

13 Answers
13

Leave a Comment