From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18426 invoked by alias); 6 Nov 2012 06:57:32 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 30781 Received: (qmail 20244 invoked from network); 6 Nov 2012 06:57:30 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.2 Received-SPF: none (ns1.primenet.com.au: domain at linux.vnet.ibm.com does not designate permitted sender hosts) Date: Tue, 6 Nov 2012 14:47:15 +0800 From: Han Pingtian To: zsh-workers@zsh.org Subject: Re: Function code breaking out of if then ...fi Message-ID: <20121106064715.GC2200@localhost.localdomain> References: <121102143911.ZM14168@torch.brasslantern.com> <20121105142942.41d73d31@pwslap01u.europe.root.pri> <20121105145501.50c674f1@pwslap01u.europe.root.pri> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Content-Scanned: Fidelis XPS MAILER x-cbid: 12110606-5112-0000-0000-00000E40FC08 This looks like also a inconsistency (or I'm missing something again): Though both 'print nosuchfile*' and 'ls nosuchfile*' return non-zero vaules, but the internal command one won't trigger ZERR trap, but the external one does: #!/usr/local/bin/zsh -feu trap 'echo caught a error' ZERR ls nosuchfile* will fail with ./t3.sh:5: no matches found: nosuchfile* caught a error but this one #!/usr/local/bin/zsh -feu trap 'echo caught a error' ZERR print nosuchfile* will fail only with ./t3.sh:5: no matches found: nosuchfile*