Script Exit Codes - 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
Syntax Errors and Script Termination
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.
If there are no misspellings in a script, it is good practice to test the commands on
Note
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.
Cisco Content Services Switch Administration Guide
8-32
OL-5647-02

Advertisement

Table of Contents
loading

This manual is also suitable for:

11500 series

Table of Contents