Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Bug(?) when using if list { list } syntax inside a for { } loop



On Mon, 5 Sep 2011 10:47:06 +0200
Daniel Friesel <derf@xxxxxxxxxxxxxxx> 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 <pws@xxxxxxx>            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



Messages sorted by: Reverse Date, Date, Thread, Author