Re: eval: Only restore exit status on exit/return

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 01/12/2018 08:45, Herbert Xu wrote:
Hmm, I think this breaks the following case which used to work:

	dash -c 'trap "(:; exit) && echo BUG" EXIT; false'

I know this makes no sense but almost every other shell does it
this way.

"Almost every other shell"? In the shells I tested, other than dash, it's evenly divided: four print nothing (bash, ksh, mksh, yash), four print BUG (bosh, pdksh, posh, zsh). Which ones are you testing?

To me, the standard is unclear on what the output should be: if at the time exit is executed, traps are reset, can what's being executed still be considered a trap action?

It's a nice test case whatever the correct result.



[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux