EasyManuals Logo

Cisco 11503 - CSS Content Services Switch User Manual

Cisco 11503 - CSS Content Services Switch
392 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #283 background imageLoading...
Page #283 background image
8-15
Cisco Content Services Switch Administration Guide
OL-5647-02
Chapter 8 Using the CSS Scripting Language
Using Logical and Relational Operators and Branch Commands
Using the while Branch Command
To execute the same commands repeatedly based on the result of an associated
expression, use the while branch command. When the expression results in a true
value (greater then 1), the script engine executes the commands within the branch.
If the result is a false value (denoted by the value of 0), then the script breaks out
of the loop and continues execution of all the commands following the endbranch
command. For example, enter:
set Counter “0”
while Counter “NEQ” “5”
echo “Counter is set to ${Counter}.”
modify Counter “++”
endbranch
echo “We're done!”
The output of this logical block is:
Counter is set to 0.
Counter is set to 1.
Counter is set to 2.
Counter is set to 3.
Counter is set to 4.
We're done!
Until the expression is not satisfied, notice that the script jumps to the beginning
of the loop and evaluates the expression each time it reaches the endbranch
command. For the first five times through the loop, Counter is set to 0, 1, 2, 3, and
4, respectively, because the script continually increments the variable. However,
on the sixth time through the loop, Counter equals a value of 5, which does not
satisfy the expression “While Counter is not equal to 5". The expression produces
a false result, which causes the loop to terminate.
As with the if command, an endbranch command terminates a while command
logical block.

Table of Contents

Other manuals for Cisco 11503 - CSS Content Services Switch

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Cisco 11503 - CSS Content Services Switch and is the answer not in the manual?

Cisco 11503 - CSS Content Services Switch Specifications

General IconGeneral
BrandCisco
Model11503 - CSS Content Services Switch
CategorySwitch
LanguageEnglish

Related product manuals