Using Arrays - Cisco 11503 - CSS Content Services Switch Administration Manual

Content services switch
Hide thumbs Also See for 11503 - CSS Content Services Switch:
Table of Contents

Advertisement

Chapter 8
Using the CSS Scripting Language

Using Arrays

For example, enter:
show variable
The output is:
$MODE = super
$LINE = console
$CHECK_STARTUP_ERRORS = 1 *Session
$UGREP =
Weight:
1
Load:
255
$SOCKET = -1
$USER = admin
$STATUS = 0
Notice in this example that there are several variables already defined in the
environment. You can also display a specific variable by invoking the show
variable command with a parameter that represents the variable name you want
to see.
For example, enter:
show variable LINE
The output is:
$LINE = console
Using Arrays
A variable can hold subvalues (elements) within its memory space. Such a
variable is commonly called a variable array or just an array. An array can hold
numeric values, strings, or both. To create an array, simply create a variable using
the set command and separate all of the array elements by spaces. For example,
enter:
set WeekDays "Sun Mon Tues Wed Thurs Fri Sat"
You can print the array like any other variable. For example, enter:
echo "Days of the week: ${WeekDays}."
The output is:
Days of the week: Sun Mon Tues Wed Thurs Fri Sat.
Cisco Content Services Switch Administration Guide
8-22
OL-5647-02

Advertisement

Table of Contents
loading

This manual is also suitable for:

11500 series

Table of Contents