help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: Zsh hackers list <zsh-workers@zsh.org>
Subject: Re: "functions -c" and TRAPxxx
Date: Thu, 9 Jun 2022 08:19:44 -0700	[thread overview]
Message-ID: <CAH+w=7aU9GTvjVHjbdqfvjAmJxQ-xJaHU2Y+4pgGkD_JkETeSg@mail.gmail.com> (raw)
In-Reply-To: <1500085568.729173.1654764913871@mail2.virginmedia.com>

On Thu, Jun 9, 2022 at 1:56 AM Peter Stephenson
<p.w.stephenson@ntlworld.com> 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.

  reply	other threads:[~2022-06-09 15:20 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-07  1:59 Bart Schaefer
2022-06-07  9:57 ` Peter Stephenson
2022-06-07 14:57   ` Bart Schaefer
2022-06-09  3:24     ` Bart Schaefer
2022-06-09  8:55       ` Peter Stephenson
2022-06-09 15:19         ` Bart Schaefer [this message]
2022-06-09 20:51           ` Bart Schaefer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAH+w=7aU9GTvjVHjbdqfvjAmJxQ-xJaHU2Y+4pgGkD_JkETeSg@mail.gmail.com' \
    --to=schaefer@brasslantern.com \
    --cc=zsh-workers@zsh.org \
    --subject='Re: "functions -c" and TRAPxxx' \


* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Code repositories for project(s) associated with this inbox:


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).