However: /why/ are you using SIGTERM? SIGINT (by default raised by ^C) is far more common for this sort of thing.
Because SIGTERM is the default signal of kill or killall maybe? And users might use that to terminate AlexTP's application if need be.
Yes, but it's far more common to hook SIGINT due to its being raised by ^C etc., or to hook both signals (which can be distinguished in the handler if necessary).
Mark, that example was less useful for me. AI's example (2nd one) was better and shorter 3x times.
But you then went and posted AI-generated code into the forum despite knowing it wasn't quite right, which other AIs will assume is correct and reproduce.
That's my last contribution to this thread.
MarkMLl