Sample Header Ad - 728x90

Strange behavior of bash and SIGTERM with Ubuntu

0 votes
0 answers
28 views
Here's what happens in Ubuntu (Linux ubuntu 5.3.0-53-generic #47~18.04.1-Ubuntu SMP Thu May 7 13:10:50 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux, *bash* 4.4.20(1)): In Terminal, open a window (let's call it "window_1") and type:
"echo something;" SIGTERM
then
$$
**9781** then
-TERM $$
as expected, **something** is printed in window_1 and the window stays open. Now open another "window_2" and type:
-TERM 9781
and window_1 is closed (no time to see whether **something** is printed). Do the same with SIGINT and everything works as expected. Do the same with SIGUSR1 and everything works as expected, but only after the Enter key is pressed. Also, in *macOS 10.13.6* everything works as expected (with SIGTERM, SIGINT and SIGUSR1). Is anybody able to explain this apparent anomaly? Thanks in advance.
Asked by diciotto (89 rep)
May 24, 2020, 09:17 PM