EasyManuals Logo
Home>Cisco>Switch>11503 - CSS Content Services Switch

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 #286 background imageLoading...
Page #286 background image
Chapter 8 Using the CSS Scripting Language
Special Variables
8-18
Cisco Content Services Switch Administration Guide
OL-5647-02
STATUS Variable
Use the STATUS variable to return the exit status of the previously executed CLI
command. In most cases, except for the grep command, an exit status of 0
indicates that a command was successful, while a non-zero value indicates that a
command failed. The CLI sets the STATUS variable automatically after each
command completes execution.
Note Using the grep command sets the STATUS variable equal to the number of lines
that satisfied the search. For details on the grep command, see “Using the grep
Command later in this chapter.
Typically, it is not necessary to examine the STATUS variable because a script
will terminate if a command does not execute properly. However, if you set the
CONTINUE_ON_ERROR variable, you can use the STATUS variable to test the
results of a command.
For example, enter:
set CONTINUE_ON_ERROR “1”
eco “Hello world”
if STATUS “NEQ” “0”
echo “Failure to execute command correctly”
endbranch
In the above example, the STATUS variable is set to a non-zero value. This value
is specific to the type of error that occurred. In this case, the script receives a
general syntax error, which informs you that the command being executed failed.
This is a typical example and one that you should watch closely when using the
CONTINUE_ON_ERROR variable. In most circumstances, you will want to
catch syntax errors as real errors.
Note When writing scripts, keep in mind that the value of the STATUS variable changes
as each command executes. If you intend to use a STATUS value later in a script,
you should save the value of the STATUS variable in another variable.

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