Cisco 11503 Administration Guide - Page 285
no set, specific errors, then you have to set the variable and then unset it when you are
UPC - 746320664958
View all Cisco 11503 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 285 highlights
Chapter 8 Using the CSS Scripting Language Special Variables The output is: Error in script playback line:2 >>>eco "Hello" ^ %% Invalid input detected at '^' marker. Script Playback cancelled. Because the script contains a spelling error, the script exits with a message telling you what went wrong. However, there may be cases where you want a script to continue on error. You can override the default behavior by setting the CONTINUE_ON_ERROR variable. When you set this variable (regardless of its value), a script continues to execute even after it encounters syntax errors or other errors. Note Exercise caution when using this variable because the CLI ignores syntax errors when the variable is set. You should set and then unset this variable in scripts where you expect a command to fail. For example, enter: set CONTINUE_ON_ERROR "1" ! Spell echo incorrectly eco "This will not print" echo "This will print" no set CONTINUE_ON_ERROR The output is: This will print Notice in the above example that the script does not print "Script Playback cancelled" and then terminate. This is because the CONTINUE_ON ERROR variable is set. In most situations, it is important that you issue a no set command on the CONTINUE_ON_ERROR variable. If you want the script to continue on specific errors, then you have to set the variable and then unset it when you are done. If you do not perform a no set command on the variable, then any other syntax errors that occur in the script will not cause an early termination. Remember, setting this variable to a value of 0 does not disable it. To disable the variable's functionality, you must unset it. OL-5647-02 Cisco Content Services Switch Administration Guide 8-17