On 2021-08-24 16:51:28 +0000, Thorsten Glaser wrote:
> Vincent Lefevre dixit:
> 
> >This is incorrect, because SIGINT should be ignored.
> >
> >This issue disappears when the subshell has several commands:
> >
> >$ mksh -c 'trap "" INT; trap; ( :; sleep 3; ); echo $?'
> >trap -- '' INT
> >^C0
> 
> Consider this:
> 
> $ mksh -c 'trap "" INT; trap; ( :; exec sleep 3; ); echo $?'
> trap -- '' INT
> ^C130
> 
> The “one” command run in the subshell is exec’d so you’re hitting
> the parent shell’s INT handler… I think.

I don't understand. Normally an exec replaces the *current* shell
by the command, not the parent shell.

I'll try to have a look later...

-- 
Vincent Lefèvre <[email protected]> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)

Reply via email to