Specifications
Version 2.0
135
goto
Usage
goto label
Description
The goto command directs script file execution to the line in the script file after the
given label. The command is not supported from the interactive shell. A label is a line
beginning with a colon (:). It can appear either after the goto command, or before the
goto command. The search for label is done forward in the script file, from the current
file position. If the end of the file is reached, the search resumes at the top of the file
and continues until label is found or the starting point is reached. If label is not found,
the script process terminates and an error message is displayed. If a label is
encountered but there is no goto command executed, the label lines are ignored.
Using goto command to jump into another for loop is not allowed, but jumping into
an if statement is legal.
Note
The goto command is only valid in script files.
Examples
# This is a script
goto Done
…
:Done
cleanup.nsh










