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 #277 background imageLoading...
Page #277 background image
8-9
Cisco Content Services Switch Administration Guide
OL-5647-02
Chapter 8 Using the CSS Scripting Language
Using Variables
To use a variable, you must supply a variable indicator to allow the CLI to
recognize the variable. The CLI searches each line of text it processes for the
variable indicator “$”. The next character must be the left brace character ({)
followed by the variable name. You terminate the variable name with the right
brace character (}). For example, if you want to print your variable to the screen
using the echo command, enter:
set MyVar “CSS11506”
echo “My variable name is: ${MyVar}”
The output is:
My Variable name is: CSS11506
Variable Types
The CLI stores a variable as either type integer or character. The CLI determines
a variable's type by the alphanumeric characters in its value. If any non-numeric
characters are present, the variable's type is character. If all the characters are
numeric, the variable’s type is integer.
Arithmetic operations on quoted numbers such as “100” are possible, but are not
possible on variables like “CSS11506” because the CLI knows that “CSS11506”
is not a numeric value. You can retrieve the variable type by appending [*] at the
end of the command string. For example, enter:
set MyVar “CSS11506”
echo “My variable type is ${MyVar}[*].”
set Number “100”
echo “My variable type is ${Number}[*].”
The output from this script is:
My variable type is char.
My variable type is int.
“Int” means integer (numeric with no decimal precision) and “char” means
character (any printable ASCII character). Anything that is not an integer is a
character. A variable that is defined as “3.14” is a character because the CLI does
not consider a period (.) to be a number.

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