How to Leave scripts running when you logoff, and exit nicely when sent a SIGTERM signal

Tech tip about the trap command. Mainly to highlight its usefulness as opposed to using the nohup command, cron commad, at command, or other ways to have a script picked up by the init process as a parent. Tip also shows the usefulness of trapping the SIGTERM, 15, signal and running commands just before a script exits.

More...