
Creating a Script File
308660-14.00 Rev 00
1-11
Setting the Current Volume or Directory
When you set the current working volume or directory using the
cd
(change
directory) command, you are setting the global variable “PWD” to the value you
specify in the command, as shown in the following script:
cd 3:
echo $PWD
3:
getenv PWD
PWD = “3:”
Controlling Program Flow
The Technician Interface provides several commands to control program flow in
your script. For details on each of the following commands, see Chapter 2.
• To specify the next line to be executed from the script file, use the
goto
command.
Within the script file, use the
goto
command with a label. A label begins and
ends with a colon (:), consists of up to 15 alphanumeric characters and the
underscore character (_), and must be on its own line, beginning in column 1.
• To evaluate whether an expression is true, use the
if
command. The expression
can compare two numerical values or two ASCII strings. If the expression is
true, the script interpreter executes any additional commands that are on the
same command line as the
if
command. If the expression is false, the script
interpreter does not execute the
if
command.
You use a semicolon (;) to end an
if
command. The semicolon separates the
if
command from the commands you want executed if the
if
command is true.
• To suspend the Technician Interface’s operation for a given interval, use the
pause
command. During this time the router is still running.
• To call a subroutine inside the same script file, use the
gosub
command. It
must be the last command on a line. You can nest subroutines up to 10 deep.
You use the
return
command in a subroutine to return to the calling routine.
When the
return
command executes, the script interpreter begins executing
the instructions on the line following the line containing the
gosub
command.
Comentários a estes Manuais