Using Variables; Creating And Setting Variables - 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

Using Variables

Using Variables

Creating and Setting Variables

Cisco Content Services Switch Administration Guide
8-8
The CLI supports user-defined variables that you can use to construct commands,
command aliases, and scripts. Variables are case-sensitive and can of type integer
or character. They can exist as either single elements or arrays of elements. All
arrays are of type character, but their elements can be used in integer expressions.
For details on arrays, see
Within a script, you can create and remove variables. During script termination,
the script engine automatically removes script-created variables from memory.
You can also create a session variable that allows a variable to remain in the
session environment after a script has exited. Additionally, if you save a session
variable to a user's profile, the variable will be recreated in the CLI session
environment upon login. For details on saving a session variable to a user profile,
refer to Chapter 3,
Configuring User
A variable name can contain 1 to 32 characters. Its value is quoted text that
normally contains alphanumeric characters. Spaces within the quoted text
delineate array elements.
To create a variable and set the variable with a value, use the set command. For
example, enter:
set MyVar "1"
This command sets the variable MyVar to a value of 1. You can also set the
variable in memory without a value. For example, enter:
set MyVar ""
This will set the variable equal to NULL (no value). This is different from a value
of 0, which is a value. You can set the variable so that it can be used across all CLI
sessions. For example, enter:
set MyVar "1" session
Saving a variable marked with the session keyword to your user profile allows you
to use the variable across CLI sessions.
Chapter 8
"Using Arrays"
later in this chapter.
Profiles.
Using the CSS Scripting Language
OL-5647-02

Advertisement

Table of Contents
loading

This manual is also suitable for:

11500 series

Table of Contents