Supervising the Network

5-31
Customizing the User Environment
Login Script Commands and Variables
GOTO
Use GOTO to execute a portion of the login script out of the regular
sequence.
Command Format
GOTO label
Use label to indicate where the login script should continue executing.
Using GOTO
Set BREAK ON in your login script before experimenting with GOTO loops
so that you can break out of a login script if necessary.
For more information about the BREAK login script command, see
“BREAK” in this chapter.
Do not use GOTO to enter or exit a nested IF…THEN statement. This usage
confuses the program.
Example
To execute a loop of commands, you could include the following lines in
your login script. In this case, the commands to be executed are labeled
AGAIN (as indicated in the second line).
SET X=“1”
AGAIN:
SET X=<X> + “1”
;see compound strings for this
WRITE <X>
IF <X> < “9” THEN GOTO AGAIN
The GOTO command looks at the value of <X> (a DOS environment
variable). If the value of <X> is less than 9, then <X> increments by 1 and
GOTO loops back to the AGAIN label. When <X> gains the value of 9, the
IF…THEN test becomes false, the GOTO is ignored, and the script
continues normally. See the IF…THEN command next.