Command
if, elseif and else
Sample Scripts
Interface Script—Monitor Port
The Monitor Port (Monport) script connects directly to a device port by logging into the SLC port,
gets the device hostname, loops a couple of times to get port interface statistics, and logs out. The
following is the script:
set monPort 7
set monTime 5
set sleepTime 2
set prompt ">"
set login "sysadmin"
set pwd "PASS"
#Send CR to echo prompt
send "\r"
sleep $sleepTime
#Log in or check for Command Prompt
SLC™ 8000 Advanced Console Manager User Guide
Description
The
command executes an associated block of commands if its Boolean
if
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
command is used in association with an
elseif
immediately follow an if or
commands if its Boolean expression evaluates to TRUE. Each command within the
block must be a Primay command. Syntax:
elseif {<Boolean expression>} {
command 1
command 2
...
command n
}
The
command is used in combination with an if or
else
provide a default path of execution. If the Boolean expressions for all preceding if
and
commands evaluate to FALSE the associated block of commands is
elseif
executed. Each command within the block must be a primary command. Syntax:
else {
command 1
command 2
...
command n
}
command. It executes an associated block of
elseif
8: Device Ports
command - it must
if
command to
elseif
145
Need help?
Do you have a question about the SLC 8000 and is the answer not in the manual?
Questions and answers