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 #292 background imageLoading...
Page #292 background image
Chapter 8 Using the CSS Scripting Language
Using Arrays
8-24
Cisco Content Services Switch Administration Guide
OL-5647-02
You can use this method to figure out how many times to perform a while
command. For example, enter:
set WeekDays “Sun Mon Tues Wed Thurs Fri Sat”
set Counter “1”
while Counter “LTEQ” “${WeekDays}[#]”
echo “Counter is set to ${Counter}.”
modify Counter “++”
endbranch
The output is:
Counter is set to 1.
Counter is set to 2.
Counter is set to 3.
Counter is set to 4.
Counter is set to 5.
Counter is set to 6.
Counter is set to 7.
Using var-shift to Obtain Array Elements
You may need to print out all the days of the week to the screen. While it is
possible to print out each array element by hardcoding the element values, it is not
always practical or possible to do this. In this case, it is obvious that there are
seven days in the week, but there may be cases where the number of elements in
a variable are unknown until the script is executed.
Use the var-shift command to push an element out of an array one at a time. For
example, enter:
set WeekDays “Sun Mon Tues Wed Thurs Fri Sat”
while ${WeekDays}[#] “GT” “0”
! Push the 1st element out of the array and shift all
! elements up one position.
echo “Day: ${WeekDays}”
var-shift WeekDays
endbranch

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