zsh-workers
 help / color / mirror / code / Atom feed
From: "Bart Schaefer" <schaefer@candle.brasslantern.com>
To: Tanaka Akira <akr@m17n.org>, zsh-workers@sunsite.dk
Subject: Re: trap problem.
Date: Thu, 29 Mar 2001 05:58:23 +0000	[thread overview]
Message-ID: <1010329055823.ZM17574@candle.brasslantern.com> (raw)
In-Reply-To: <hvo8zlpw8eg.fsf@flux.etl.go.jp>

On Mar 29, 12:39pm, Tanaka Akira wrote:
} Subject: trap problem.
}
} trap doesn't work as follows.
} 
} % Src/zsh --version
} zsh 4.0.1-pre-2 (i386-unknown-freebsd4.2)
} % Src/zsh -fc 'trap "echo INT" INT; sleep 60'
} ^C
} %
} 
} It should print `INT' but it doesn't.

That's because zsh has been extremely clever and has `exec'd "sleep 60",
so there's no zsh process around any more to execute the trap.

Try:	Src/zsh -fc 'trap "echo INT" INT; sleep 60; sleep 1'

and you'll see ...

Perhaps zsh's tests for whether the last command can be `exec'd should
include testing whether there are any user-defined traps in effect?

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   


  reply	other threads:[~2001-03-29  6:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-03-29  3:39 Tanaka Akira
2001-03-29  5:58 ` Bart Schaefer [this message]
2001-03-30  7:57   ` Tanaka Akira
2001-03-30  9:36   ` Peter Stephenson
  -- strict thread matches above, loose matches on Subject: below --
1999-03-05 11:32 Thomas Ziehmer
1999-03-05 11:24 ` Peter Stephenson

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:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

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

  git send-email \
    --in-reply-to=1010329055823.ZM17574@candle.brasslantern.com \
    --to=schaefer@candle.brasslantern.com \
    --cc=akr@m17n.org \
    --cc=zsh-workers@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

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).