Customizing the user environment

GOTO

Use GOTO to execute a portion of the login script out of the regular sequence.

GOTO has the following cmmand format:

GOTO label

Use label to indicate where the login script should continue executing.

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''.


NOTE: Do not use GOTO to enter or exit a nested IF...THEN statement. This usage confuses the program.

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.
© 1999 The Santa Cruz Operation, Inc. All rights reserved.
UnixWare 7 Release 7.1.1 - 5 November 1999