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

Problems with for loops



Users,
    I have used zsh for many years now and haw just now started to scratch
the surface of its potential.  My current hurdle is the for loop.  The
manual entry at http://sunsite.auc.dk/zsh/Doc/zsh_5.html#IDX33 gives the
following syntax for the for loop that I want to use.

for (( [expr1] ; [expr2] ; [expr3] )) do list done


This is my test script:

#!/bin/zsh
((i = 0))
for (( i -eq 0; i -le 10; i++ )) do echo "$i\n" done


When I execute this script, I get the following

./array_test.zsh: parse error near `(( i -eq 0' [3]


I know this is likely a newbie question but I have struggled with it for 3
days.  Any help will be greatly appreciated.

Thank you,

Allen Belk

 | Allen Belk, Systems Manager
 | Office of Technology Resources
 | University of Southern Mississippi
 | allen.belk@xxxxxxx  601.266.6013





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