Chapter 8
Using the CSS Scripting Language
Note
Syntax Errors and Script Termination
Syntax Errors
OL-5647-02
The script overwrites the original value of the variable VALUE. You can use the
BOR operator in a similar manner. The mechanics of AND and OR logical
operations is beyond the scope of this document.
You can create complex scripts using the CSS Scripting Language. During the
development of a script, you may encounter a few syntax errors. When a script
exits because of a syntax error, the CLI indicates the script line number and the
script text where the syntax error occurred.
The CLI also allows you to exit from a script and specify the exit value (zero or
non-zero) using the exit script command. This lets you know exactly why a script
failed. You can then use this information to initiate a decision process to handle
the error condition.
When you play a script that contains a misspelled command, an unknown
command, or a failed command, the script displays a syntax error on the screen.
The error message contains the number and the text of the line in the script that
caused the failure. The CSS software sets the STATUS variable to the appropriate
error code (a non-zero value).
For example, enter:
Error in script playback in line: 1
>>>eco "Hello"
^
%% Invalid input detected at '^' marker.
Script Playback cancelled.
If a script issues a command that returns a non-zero STATUS code, this will also
result in a syntax error. For example, if you play a script that issues a socket
connect command and the host refuses the connection or there is a host name
resolution failure, the script terminates with a syntax error.
Syntax Errors and Script Termination
Cisco Content Services Switch Administration Guide
8-31