Chapter 8 Using the CSS Scripting Language
Bitwise Logical Operators
8-30
Cisco Content Services Switch Administration Guide
OL-5647-02
Using the SCRIPT_PLAY Function
To call a script from another script, use the
SCRIPT_PLAY
function. The syntax
is:
function SCRIPT_PLAY call
“ScriptName arg1 arg2...”
When you use the
SCRIPT_PLAY
function, use caution when dealing with the
exit script
command. For details on exiting from a script, see
“Exiting a Script
Within Another Script”
later in this chapter.
Bitwise Logical Operators
The CSS Scripting Language provides two operations for bit manipulation that
apply only to numeric values. The bitwise logical operators are:
•
BAND
- Bitwise AND operation
•
BOR
- Bitwise OR operation
You can manipulate the bits of a numeric variable using the
modify
command. For
example, if you have a numeric value of 13 and want to find out if the second and
fourth bits of the number are turned on (value of 1), you can do so using a bitwise
AND operation as follows:
00001101 (13)
AND 00001010 (10)
Result is 00001000 (8)
Notice that the fourth bit is common between the values 13 and 10, so the resulting
value contains only the common bits. To script this, do the following:
set VALUE “13”
modify VALUE “BAND” “10”
echo “Value is ${VALUE}”
The output is:
Value is 8