From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10620 invoked by alias); 2 Nov 2012 09:35:13 -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: 30774 Received: (qmail 10450 invoked from network); 2 Nov 2012 09:35:02 -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=-1.6 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,HTML_MESSAGE,NML_ADSP_CUSTOM_MED,RCVD_IN_DNSWL_LOW, T_DKIM_INVALID,T_TO_NO_BRKTS_FREEMAIL autolearn=no version=3.3.2 Received-SPF: pass (ns1.primenet.com.au: SPF record at _spf.google.com designates 209.85.223.171 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=z2/5dYwfBWRjfV+ygix5nt9SEJSLzIasETmXV5UuP7w=; b=bQXrfPJvFbd//IEub73EdIs8rjPsW8DqkZZ9mvbjbN+CRf7Br22fL+MobMxF1DSLJL UGL/3InpNcLASvdIG++B901e4hLsVvI/RyOUZnl2qQcL3mjDy3C5Q9vQ3xSYfc1JSl+J tYhAfxW++OtMp2a4nLcjeXPyuk5oyzOZnvum5JZvIC1qtDR2mz0o+tGDd/xEnrAIxKVx 9LStYm1bL02tQyz/JdyI8r91Ax6CD7qSfnKvymeOdn+OpTS9xDEIc13ATKw2ouLaUYVV 2pdRimPITRLe4j4VZU9u9uFJ+cmRsOfCl5liX0i3h2nvcWy+q8v/K4Nhlu+babVfY6+R hS1Q== MIME-Version: 1.0 Date: Fri, 2 Nov 2012 10:09:09 +0100 Message-ID: Subject: Function code breaking out of if then ...fi From: Michal Maruska To: zsh-workers@zsh.org Content-Type: multipart/alternative; boundary=e89a8f502f8e0d2be204cd7f7d27 --e89a8f502f8e0d2be204cd7f7d27 Content-Type: text/plain; charset=UTF-8 Hello, I wonder if the following behaviour is a bug, or simply my wrong expectation: This script, assuming the globbing fails, and I'm not using NULL_GLOB, does not bother finishing the commands in the "then ....fi" block, instead continues after "fi". #! /usr/bin/zsh -feu fn () { foreach sum (non-existing*) {echo $sum} } if true; then fn exit 0 fi echo tragedy exit -1 --------------------------- I was advised (on IRC) to use { fn } always { TRY_BLOCK_ERROR=0 } But I'd like to see the behaviour documented in the chapters not about " {} always {} ". Thank you --e89a8f502f8e0d2be204cd7f7d27--