while command

Loops through a block of commands while a condition is true.

All Usages Examples

See also: for, foreach

Usages

  1. while (condition) ... end

The while statement tests condition and if it’s true, loops over the instructions between the while and end statements, then repeats.

Examples

set i = 0
while ( $i < 10 )
    set i = `$i+1`
    echo $i
end