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

Re: evaluating a condition




Gaspar Bakos wrote:
> 
> Hi,
> 
> As a beginner in zsh, I would have a question concerning an 'if'
> structure.
> 
> I have the following script, and I would like to print the numbers in the
> terminal from ${min} to ${max}, if both of them are smaller than 10.
> 
> export min=$3;export max=$4;
>         if (($[min]<10 && $[max]<10)) then
>                 for i in {${min}..${max}}; do echo $i; done
>         fi
> 
> However, this prints the numbers even if ${max}>10
> 
> Can someone help?
> 
> Gaspar

What version of zsh are you using?
With zsh 3.1.6, your code works fine



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