Top
Systemwalker Operation Manager V17.0.1 Reference Guide

15.2.20 while (Execute a Loop)

Description

Repeats processing as long as a condition is met.

Synopsis

while {test} {body}

Options

test

Specify the conditional expression that repeats a loop (body). For a numeric value, 0 is false and anything other than 0 is true. For a string value, true and yes are true and false and no are false. Do not put a comment into conditional expression.

Condition operators valid for conditional expressions

!

NOT

< , > , <= , >= , == , !=

Comparison

&& , ||

Logical AND, Logical OR

body

The script command executed as long as the condition is true. Two or more commands can be written by being separated by line breaks or semicolons.

Cautions

Example

The following example executes a loop five times.

set i 0
while {$i < 5} {
      incr i
}