Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: How to trap to script EXIT instead of function EXIT?
- X-seq: zsh-users 23786
- From: Peng Yu <pengyu.ut@xxxxxxxxx>
- To: schaefer@xxxxxxxxxxxxxxxx
- Subject: Re: How to trap to script EXIT instead of function EXIT?
- Date: Mon, 3 Dec 2018 08:05:34 -0600
- Cc: zsh-users <zsh-users@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=DFbA05kpgtxGmHpVuoLOKqYTfZOMZRGv8RZNrzxJkJ8=; b=VOK6ZYtnkpfGukcuZegzzptK1NiU6JqHQ2BqSEqX4IzW0X/QWNndIlw2J5OzF1qEL4 dX0ouhNMkCC/nu5+ESMoeglfL5UxV+1mKL2AkSrC4a1ykdWST3I/T2hY0Ofp/jgg8jvr jyT7sJdg3K7iHQr76ZWv/WzfP3uEiGtaAXDBO1WIVXCx1BOEGGx+b8kycT5kUhYbWpbQ IJqVFtj7NQ9T0fP7rLhOYnY+xoUA332cB6rSj9PxQCmIQLoSS5OE5wAc5Xb7mvxSZ1a+ 4l4wYH9LPdnZrqX7A1eRwdiHbUIEVoTo0wO+o5+Xgkg9ej7XkHvkv5YD3lSUMO4jhtzv 9Xbg==
- In-reply-to: <CAH+w=7YO4MKDardEMtc-2dwSY0N0Nt9vbKd2-n-QiobBOixtaA@mail.gmail.com>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- List-unsubscribe: <mailto:zsh-users-unsubscribe@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <CABrM6wm-dKVroNPXA3-ogthrW4ErbA603cPcbNyxNvb+Dz2ppQ@mail.gmail.com> <CAH+w=7YO4MKDardEMtc-2dwSY0N0Nt9vbKd2-n-QiobBOixtaA@mail.gmail.com>
On Mon, Dec 3, 2018 at 1:41 AM Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
>
> On Sun, Dec 2, 2018 at 8:10 PM Peng Yu <pengyu.ut@xxxxxxxxx> wrote:
> >
> > The following example shows that `trap` inside a function is trapped
> > to the function. This behavior is different from bash. Is there a way
> > to make it the same as bash?
>
> setopt posixtraps
>
> Or more generally, "emulate sh".
Thanks.
If function f1 calls function f2, I want to call trap in f2 which
actually set the trap for f1. Is it possible?
--
Regards,
Peng
Messages sorted by:
Reverse Date,
Date,
Thread,
Author