Re: Bug#910276: mksh does never execute an "EXIT trap", if it is created with the "trap" command in a sub shell

2018-10-06 Thread Thorsten Glaser
Bernd Schumacher dixit: >Please confirm, that this is a bug and not the expected behaviour of mksh. I still cannot confirm either way, but some preliminary research with an extended test script: $ cat script fkt() { trap -- "echo $1 >&2" EXIT } fkt shell_exit $(fkt fn_exit) $(trap -- "echo

Re: Bug#910276: mksh does never execute an "EXIT trap", if it is created with the "trap" command in a sub shell

2018-10-06 Thread Martijn Dekker
The bug concerned the EXIT pseudosignal. But, apparently, mksh does not execute subshell-specific traps for real signals either: $ mksh -c '(trap "echo int_subsh" INT; kill -s INT $BASHPID); echo end' end $ bash -c '(trap "echo int_subsh" INT; kill -s INT $BASHPID); echo end' int_subsh end

Re: Bug#910276: mksh does never execute an "EXIT trap", if it is created with the "trap" command in a sub shell

2018-10-06 Thread bernd
Thank You Thorsten, I hoped, it would be obvious that this is a bug and mksh could be fixed. It is strange, that mksh lets me define an exit trap without error, but then ignores the trap. But things seem not to be so easy. I think the use case of the "subshell_exit" is obvious. But I will