8.0;while, revision 8.0, 84/03/20
WHILE -- Execute a conditional statement.
usage: WHILE command_1 DO command_2 ... ENDDO
FORMAT
WHILE command_1 DO command_2 ... ENDDO
WHILE executes a command (or commands) as long as the results of a Boolean
test are true. You can extend the WHILE command over several lines if you use
it interactively or in a Shell script. When you use WHILE interactively, and
extend the command over more than one line, the Shell prompts you for each new
line of the command with the $_ prompt (refer to the example below).
ARGUMENTS
command_1
(required) Specify a command or program to execute and test for truth,
or specify a variable expression or Boolean variable to
test for truth. "Truth" usually means that the command
executes successfully (without any errors), or that a Shell
variable expression or Boolean is "true". (Specifically,
this argument is evaluated TRUE if it returns an abort
severity level of 0 (zero).)
Refer to Chapter 3 of the DOMAIN System Command Reference
Manual for more information on Shell variables.
command_2 ...
(required) Specify the command(s) or program(s) to execute if
command_1 returns TRUE.
EXAMPLES
1. $ K := 3 (set var K = 3)
$ WHILE ((^K > 0)) DO args ^k; k := k-1 enddo (body of WHILE)
3 (output of WHILE)
2 .
1 .
$
RELATED TOPICS
More information is available. Type:)
- HELP ABTSEV
for more information on abort severity levels.
- HELP EXIT
for details about exiting from a WHILE loop.