n8dandy dixit:
>Yesterday, I was extensively using traps with mksh and I noticed something
>unexpected.
>Let's consider the following example, from the book "Learning the Korn shell,
>2nd
Well, mksh isn’t AT&T ksh ☺
In general, the *first* edition of that book (orelly/unix/ksh/)
works better with mksh, as the second edition, which I do own in
print, mostly deals with stuff new in ksh93 that doesn’t exist
in mksh anyway.
>>From the mksh manpage, we can read this paragraph :
>
>A separate trap/signal environment will be used during the execution
>of functions. This will mean that traps set inside a function will
>not affect the shell's traps
>
>Could you tell me if I missed something ?
The paragraph you cited is a list element under a list headed thus:
In the future, the following differences may also be added:
Basically: “this is the plan, but we’re not there yet”
Also, under “trap”:
The original Korn shell's DEBUG trap and the handling of ERR and
EXIT traps in functions are not yet implemented.
bye,
//mirabilos
--
“It is inappropriate to require that a time represented as
seconds since the Epoch precisely represent the number of
seconds between the referenced time and the Epoch.”
-- IEEE Std 1003.1b-1993 (POSIX) Section B.2.2.2