9: Device Ports
SLCâ„¢ 8000 Advanced Console Manager User Guide 205
Custom Script Syntax
This section describes the scripting syntax for Custom Scripts. The syntax is more flexible than
Interactive Script syntax, but still has restrictions to prevent the creation of scripts containing
potentially harmful commands. In addition, Custom Scripts can be configured to use command line
parameters. Custom Scripts have the following guidelines:
1. The size of the script file cannot exceed 6 Kbytes.
2. The size of the results generated by the script cannot exceed 1 Kbyte (any results over 1Kbyte
will be truncated).
3. The first line of the script must contain a Linux script style interpreter directive so that the SLC
will know which interpreter to use to run the script. Currently only Expect is supported. The
format of the first line is #! expect, #! tcl, or #! python. When a custom script is
imported, the interpreter line must match the selected script or file type (Expect, Tcl, or
Python), otherwise the script will be invalid.
4. The script should include a spawn command to connect the script to either a SLC CLI session
or a SLC Device Port session. Refer to the following spawn command syntax:
if, elseif and else
The
if command executes an associated block of commands if its Boolean
expression evaluates to TRUE. Each command within the block must be a Primary
command. Syntax:
if {<Boolean expression>} {
command 1
command 2
...
command n
}
The
elseif command is used in association with an if command - it must
immediately follow an if or
elseif command. It executes an associated block of
commands if its Boolean expression evaluates to TRUE. Each command within the
block must be a Primary command. Syntax:
elseif {<Boolean expression>} {
command 1
command 2
...
command n
}
The
else command is used in combination with an if or elseif command to
provide a default path of execution. If the Boolean expressions for all preceding if
and
elseif commands evaluate to FALSE the associated block of commands is
executed. Each command within the block must be a Primary Command. Syntax:
else {
command 1
command 2
...
command n
}
Command Description