Using the echo Command
Using the echo Command
Note
Using Commented Lines
Cisco Content Services Switch Administration Guide
8-6
When you play a script, the default behavior of the script is to display each
command and its output. Use the echo command to control what appears on the
screen during script execution. Because the goal of most scripts is to present clear,
useful output, it is good practice to disable the echo command by using the no
echo command. The no echo command tells the script engine not to print the
commands being processed or their output to the terminal. Once you disable the
echo command, you must use the echo command explicitly to print text to the
screen.
Echo is enabled automatically upon script termination. For a further explanation
of the echo and no echo commands, see
in this chapter.
All of the examples and their outputs shown in the remainder of this chapter
assume that the echo command is disabled, unless otherwise stated.
To write scripts that other users can understand and maintain, it is important to
document your script with comments. Comments are particularly important when
other users begin using and/or modifying your scripts. To make this process easier
for you, you can add commented lines to your scripts. You denote comments with
the exclamation mark (!) as the first character in any line of a script.
For example, enter:
! I want a comment here so that I can tell you that I will
! execute a show variables command
show variables
This example begins with a comment for the user to read (note the exclamation
mark). Any characters are allowed after a comment symbol, but the entire line
must be a comment. In the third line, the script will execute a show variables
command because it does not start with an exclamation mark.
Chapter 8
Using the CSS Scripting Language
"Using the "! no echo" Comment"
later
OL-5647-02