Cisco 11503 Administration Guide - Page 284
Special Variables, Informational Variables, CONTINUE_ON_ERROR Variable
UPC - 746320664958
View all Cisco 11503 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 284 highlights
Special Variables Chapter 8 Using the CSS Scripting Language Special Variables Within the CLI, there are sets of predefined variables that you can use in scripts to add more power to your scripts. Some of these predefined variables change how scripts react, while others are merely informational variables. None of the special variables requires user intervention for cleanup. However, it is good practice to remove both the CONTINUE_ON_ERROR and the EXIT_MSG variables following the execution of their relevant command blocks. Informational Variables The informational variables are: • LINE - Line name (for example, pty1, console, etc.). • MODE - Current mode of command (for example, configure, boot, service). • USER - The currently logged in user (for example, admin, bob, janet). • ARGS - A list of arguments passed to a script from the CLI. See "Using Command Line Arguments" later in this chapter. • UGREP - A line of text obtained using the grep -u command. • CHECK_STARTUP_ERRORS - A session variable that determines whether or not a user is informed of startup errors upon login. CONTINUE_ON_ERROR Variable Use the CONTINUE_ON_ERROR variable to control how a script that is executing in an interactive CLI session handles command failure. By default, a script terminates when it encounters an error. For example, if you use the echo command to print out information from a script and spell the command incorrectly, the script exits with a syntax error and prints out the line in which the error occurred. For example, enter: ! Spell echo incorrectly eco "This will not print" 8-16 Cisco Content Services Switch Administration Guide OL-5647-02