Re: Expect Script Loop issue
Remove the brackets around the incr command:
set i 0
while {$i < 51} {
echo $i
incr i 1
}
-Dan
On Thu, 2003-10-02 at 11:29, Jeff wrote:
> This is a little OT, but I'm in a bind.
>
> I'm trying to write an Expect script that loops from 0 to 50,
> incrimenting the value of i until the condition {i < 51} breaks the
> loop.
>
> I can't seem to get this to work. This section of the script executes
> only once:
>
> set i 0
> while {$i < 51} {
> do stuff
> do more stuff
> {incr i 1}
> }
>
> Can someone tell me why this doesn't run through 50 times and exit?
>
> thanks,
> jc
>
>
> --
> Jeff Coppock Systems Engineer
> Diggin' Debian Admin and User
>
Reply to: