From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5512 invoked by alias); 5 Sep 2011 09:37:42 -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: 29749 Received: (qmail 4704 invoked from network); 5 Sep 2011 09:37:37 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, SPF_HELO_PASS autolearn=ham version=3.3.1 Received-SPF: none (ns1.primenet.com.au: domain at csr.com does not designate permitted sender hosts) Date: Mon, 5 Sep 2011 10:08:49 +0100 From: Peter Stephenson To: Subject: Re: Bug(?) when using if list { list } syntax inside a for { } loop Message-ID: <20110905100849.7acf196e@pwslap01u.europe.root.pri> In-Reply-To: <20110905084706.GA26219@derf.homelinux.org> References: <20110905084706.GA26219@derf.homelinux.org> Organization: Cambridge Silicon Radio X-Mailer: Claws Mail 3.7.9 (GTK+ 2.22.0; i386-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.103.10.104] X-Scanned-By: MailControl A-12-01-02 (www.mailcontrol.com) on 10.71.0.121 On Mon, 5 Sep 2011 10:47:06 +0200 Daniel Friesel wrote: > Hi everyone, > > It looks like it's not possible to use if [[ ]] { } syntax inside a > for { } loop: > > descent ~/bin > for i (*) { if [[ -r $i ]] { echo $i } } > for elif> You need a semicolon or newline after the first "}", just as you would if you were using the more standard "then" and "fi". -- Peter Stephenson Software Engineer Tel: +44 (0)1223 692070 Cambridge Silicon Radio Limited Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, UK Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom More information can be found at www.csr.com. Follow CSR on Twitter at http://twitter.com/CSR_PLC and read our blog at www.csr.com/blog