9.0;exit, revision 9.0, 85/03/27
EXIT -- Exit from a loop.
usage: EXIT
FORMAT
EXIT
EXIT terminates the flow of control in a Shell loop construct (FOR, SELECT,
and WHILE). When EXIT is encountered, control passes to the first command
following the body of the loop (see example below).
You may also interrupt the flow of control in a loop without actually leaving
the loop by using the NEXT command. Type HELP NEXT for more information.
Do not confuse this command with the DM command EX, which exits the Display
Manger and returns control to the Boot Shell. Type HELP EX for more
information.
The EXIT command requires no arguments or options.
EXAMPLES
Consider the following section from a Shell script:
WHILE ((true))
DO READC a
IF ((^a = "y")) THEN EXIT ENDIF
ARGS "still looking ..."
ENDDO
ARGS "Finished."
When the READC (READ_CHARACTER) command reads a character into variable "a"
that matches the character "y", the EXIT command executes and causes the
script to jump to the command following the ENDDO.
For more information on variables, refer to the DOMAIN System User's Guide.
RELATED TOPICS
More information is available. Type:
- HELP 'FOR'
for information on FOR loops.
- HELP 'SELECT'
for information on SELECT loops.
- HELP 'WHILE'
for information on WHILE loops.