Hitachi

Job Management Partner 1 Version 10 Job Management Partner 1/Advanced Shell Description, User's Guide, Reference, and Operator's Guide


until statement (loops until a condition is true)

Organization of this page

Format 1

until condition
do
        processing
done

Format 2

until condition;do
        processing
done

Summary

This control statement executes specified processing repeatedly until a specified condition becomes true.

Description

This statement begins with until, followed by do, and ends with done. A condition can be any command or a group of commands combined using operators such as &&, ||, ( ), and { }. The processing described between do and done is performed repeatedly until the return code from executing the command or the command group specified as the condition becomes 0. To exit from the until statement, there must be a change created by the processing described between do and done such that the condition becomes satisfied. If the condition is already satisfied when the until statement begins, the statement terminates without executing the specified processing.

do and done cannot be omitted. Without a matching pair of do and done, the syntax is invalid and the statement will terminate with an error.

If you specify a semicolon (;) immediately after condition, you can continue specifying the statement on the same line.

Usage example