Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: trap does not work in a trap function?
- X-seq: zsh-users 15375
- From: "Dominik Vogt" <dominik.vogt@xxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Re: trap does not work in a trap function?
- Date: Thu, 09 Sep 2010 10:17:33 +0200
- In-reply-to: <20100909080214.76320@xxxxxxx>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <20100909080214.76320@xxxxxxx>
> The attached small script behaves in an unexpected way (at least to me):
Hmpf, the attachment has been stripped from the mail somwhere
on the way:
-- BEGIN sigtest
#!/usr/bin/zsh
shutdown () {
echo shutdown
trap - EXIT
exit 77
}
trap shutdown EXIT
shutdown
-- END sigtest
> $ ./sigtest
> shutdown
> shutdown
>
> Why is the shutdown function called again by exit when the EXIT trap was
> just removed? This looks like the trap builtin does not properly work from
> within a trap handler.
--
GMX DSL SOMMER-SPECIAL: Surf & Phone Flat 16.000 fÃr nur 19,99 Euro/mtl.!*
http://portal.gmx.net/de/go/dsl
Messages sorted by:
Reverse Date,
Date,
Thread,
Author