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 #302 background imageLoading...
Page #302 background image
Chapter 8 Using the CSS Scripting Language
Using the grep Command
8-34
Cisco Content Services Switch Administration Guide
OL-5647-02
Exiting a Script Within Another Script
It is possible to play a script from another script using the function
SCRIPT_PLAY. For details on playing a script, see “Using the SCRIPT_PLAY
Function” earlier in this chapter. In this case, be careful when dealing with the exit
script command in the secondary script.
If script A invokes script B and script B issue an exit script command, both scripts
will exit. Therefore, it is important that a script calling another script either
removes any exit script commands in the second script or makes other
arrangements to handle this behavior.
Using the grep Command
To search for specified data and place the last line of the search results in a
variable called UGREP, use the grep command with the -u option. For example,
to create a script to search for the Keepalive field in the show service command
on a service called S1, enter:
!no echo
show service S1 | grep -u “Keepalive”
echo “The line is: ${UGREP}”
The output is:
The line is: Keepalive: (SCRIPT a-kal-pop3 10 3 5)
Because the show service screen contains the field Keepalive, the entire line is
stored in the UGREP variable. You can also extract each space-separated element
by treating the UGREP variable as an array. For example, to extract the first block
of text, enter:
!no echo
show service S1 | grep -u “Keepalive”
echo “The first element in the line is: ${UGREP}[1]”
The output is:
The first element in the line is: Keepalive:

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