kill tail(1) when sh exits
https://dacav.roundhousecode.com/blog/2019-10/17-kill-tail-1-when-sh-exits.html [dacav.roundhousecode.com]
2019-10-17 17:24
As a solution, the POSIX shell provides a built-in named trap, documented here. In short it allows to define actions to be executed upon signaling, and that includes shell termination. It is similar to atexit(3) in POSIX C.
source: L