From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24203 invoked by alias); 13 May 2017 14:19:14 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 22694 Received: (qmail 23690 invoked from network); 13 May 2017 14:19:14 -0000 X-Qmail-Scanner-Diagnostics: from 195.159.176.226 by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(195.159.176.226):SA:0(1.3/5.0):. Processed in 1.497636 secs); 13 May 2017 14:19:14 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: * X-Spam-Status: No, score=1.3 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, RDNS_NONE autolearn=no autolearn_force=no version=3.4.1 X-Envelope-From: gcszu-zsh-users@m.gmane.org X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: none (ns1.primenet.com.au: domain at m.gmane.org does not designate permitted sender hosts) X-Injected-Via-Gmane: http://gmane.org/ To: zsh-users@zsh.org From: Thorsten Kampe Subject: trap inconsistency between platforms Date: Sat, 13 May 2017 16:18:52 +0200 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@blaine.gmane.org User-Agent: MicroPlanet-Gravity/3.0.4 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