From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17692 invoked by alias); 5 Nov 2012 09:32:12 -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: 30777 Received: (qmail 21683 invoked from network); 5 Nov 2012 09:32:11 -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: Mon, 5 Nov 2012 17:31:55 +0800 From: Han Pingtian To: zsh-workers@zsh.org Subject: Re: Function code breaking out of if then ...fi Message-ID: <20121105093155.GB2200@localhost.localdomain> References: <121102143911.ZM14168@torch.brasslantern.com> <20121105082250.GA2200@localhost.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20121105082250.GA2200@localhost.localdomain> User-Agent: Mutt/1.5.21 (2010-09-15) X-Content-Scanned: Fidelis XPS MAILER x-cbid: 12110509-1976-0000-0000-00001311F9A2 On Mon, Nov 05, 2012 at 04:22:50PM +0800, Han Pingtian wrote: > On my latop, if use 'echo non-existing*' in the if command, the > script will exit immediately, looks like the glob failure is > considered an error of ERR_EXIT. And changing to > > { echo non-existing* } always { TRY_BLOCK_ERROR=0 } > > doesn't help, it still exits immediately. In the contrast, using 'fn' > won't trigger ERR_EXIT. But the failure of 'echo non-existing*' won't trigger a 'trap "..." ZERR' command at the sametime, this isn't like a normal failing command will do ...