2015-09-21 17:35:36 +0200, Jilles Tjoelker: [...] > > One could also argue, that to be consistent, SIGTSTP and SIGQUIT > > should be treated similarly (strangely enough > > http://www.cons.org/cracauer/sigint.html doesn't mention SIGTSTP). > > Agreed for SIGQUIT, but not for SIGTSTP. For SIGTSTP, either the shell > has job control enabled or it does not. If it does, SIGTSTP stops the > job and continues the shell; if it does not, SIGTSTP stops the whole job > including the shell. [...]
Note sure what you mean, we may not be talking of the same thing. What I meant: In: sh -c '(trap "" INT; sleep 10); echo done' If you send ^C, nothing happens. In: sh -c '(trap "" TSTP; sleep 10); echo done' If you press ^Z, the "sh" is suspended, but "sleep" keeps running in background. One could argue they should be treated the same (that sh shouldn't suspend itself if the process it's currently waiting for has not been suspended, just like for ^C it should not die of SIGINT if the process it's currently waiting for has not died of SIGINT). You may be talking of: sh -mc 'sleep 10; echo "$?"' where SIGINT upon ^C, SIGTSTP upon ^Z is sent to sleep only (not sh). -- Stephane