Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: "functions -c" and TRAPxxx



On Thu, Jun 9, 2022 at 1:56 AM Peter Stephenson
<p.w.stephenson@xxxxxxxxxxxx> wrote:
>
> Looks like the only way for settrap to fail is using a signal number
> that's not handled interactively.

% trapper() { print $0 }
% for t in $(kill -l)
for> do functions -c trapper TRAP$t || echo cannot $t
for> done
%

So as far as I can tell it's not possible for settrap() to fail (on
ubuntu, anyway) if getsignum() succeeds.

Some of those traps are ignored (STOP, KILL) but you can set them anyway.




Messages sorted by: Reverse Date, Date, Thread, Author