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 #300 background imageLoading...
Page #300 background image
Chapter 8 Using the CSS Scripting Language
Syntax Errors and Script Termination
8-32
Cisco Content Services Switch Administration Guide
OL-5647-02
For example, enter:
!no echo
socket connect host 192.168.1.1 port 84 tcp
socket disconnect ${SOCKET}
This script works well as long as neither command fails. However, suppose that
the host 192.168.1.1 does not exist. Playing the script produces an error as
follows:
Error in script playback line:2
>>>socket connect host 192.168.1.1 port 84 tcp
CSS11506#
Script Playback cancelled.
The script failed because of an error in line 2. Notice that the command is not
misspelled and all syntax is correct. However, the command issued a non-zero
error code because of its failure to connect. The next command, socket
disconnect, never executes because of the failure of the first command.
The CLI considers this type of error a “syntax error”. To discover what went
wrong, issue the questionable command directly on the CLI.
For example, enter:
socket connect host 192.168.1.1 port 84 tcp
%% Failed to connect to remote host
The CLI displays the reason why the command failed.
Note If there are no misspellings in a script, it is good practice to test the commands on
the CLI.
Script Exit Codes
When a script terminates, it returns an exit code. The software places the exit code
value in the STATUS variable (for reference after the script is invoked). There are
two possible script exit code values: zero (success) and non-zero (failure).
To ensure a successful exit code, use the exit script command with a value of zero
(the default). The integer value is optional with this command.

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