Are you implying that it's not possible to catch a terminal signal

in ksh while you're inside a ksh built-in or in an external command

because in ksh it's delivered as error and caught by the ERR trap?

How sensible is that? - As said, bash and zsh behave more sensibly.

So are you saying that the observed behaviour is no bug in ksh but

works as designed? - I'd be curious about a rationale for that.


Thanks.


Janis

________________________________
Von: Bruce Lilly <[email protected]>
Gesendet: Freitag, 28. April 2017 01:44
An: Janis Papanagnou
Cc: [email protected]
Betreff: Re: [ast-users] trap issue

Your example used sleep, which in some cases is a built-in and
in other cases is an external program.

For testing purposes, you might want to try something different,
e.g. a select statement which will wait for input, and which you
can interrupt:

TMOUT=10
PS3=""
select foo in ""
do :
done

[note that this doesn't do anything useful, and will loop until
it times out if not terminated by a signal or EOF followed by
return]

That should run your interrupt trap when interrupted from the
terminal.  And you could send a signal explicitly (e.g. from
another shell) and that also should trigger your traps.

Note that select is a keyword -- it is processed directly by
ksh -- as opposed to built-in functions and external programs.
_______________________________________________
ast-users mailing list
[email protected]
http://lists.research.att.com/mailman/listinfo/ast-users

Reply via email to