Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

3
  • I think you mix it with SIGKILL. I did trap TERM, because without the trap line the script exits immediately when I sent the signal, while with the trap 'echo hello' SIGTERM it does not exit, and it prints hello, just not right away Commented Jan 24, 2016 at 14:18
  • Could the sleep be the problem? Any traps you have in place would not be executed before sleep has ended (for more on this, see this question in SO). Commented Jan 30, 2016 at 16:21
  • @SamiLaine, interesting, I'll have a try tomorrow with my original code (java instead of sleep) Commented Jan 30, 2016 at 18:09