zsh-users
 help / color / mirror / code / Atom feed
From: Thorsten Kampe <thorsten@thorstenkampe.de>
To: zsh-users@zsh.org
Subject: trap inconsistency between platforms
Date: Sat, 13 May 2017 16:18:52 +0200	[thread overview]
Message-ID: <of74k7$olq$1@blaine.gmane.org> (raw)

Hi,

the below code fragment generates...

TRAPPED ON ERROR
TRAPPED ON EXIT

...on Cygwin, Linux and macOS with Bash and on Cygwin 
and macOS with Zsh.

On Linux with Zsh it only generates...

TRAPPED ON ERROR

```
# will also run on error (except with zsh on Linux)
exit_handler() { echo "TRAPPED ON EXIT"; }

error_handler() {
    error_code=$?
    echo "TRAPPED ON ERROR"
    exit $error_code
}

trap exit_handler EXIT
trap error_handler ERR

false
```

Cygwin 2.8.0, zsh 5.3.1, bash 4.4.12
Ubuntu 17.04, zsh 5.2, bash 4.4.5
macOS Sierra, zsh 5.3.1, bash 4.4.12

Thorsten


             reply	other threads:[~2017-05-13 14:19 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-13 14:18 Thorsten Kampe [this message]
2017-05-13 18:25 ` 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:
  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='of74k7$olq$1@blaine.gmane.org' \
    --to=thorsten@thorstenkampe.de \
    --cc=zsh-users@zsh.org \
    /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).