Cisco 11503 Administration Guide - Page 290
Using Arrays
UPC - 746320664958
View all Cisco 11503 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 290 highlights
Using Arrays Chapter 8 Using the CSS Scripting Language For example, enter: show variable The output is: $MODE = super $LINE = console $CHECK_STARTUP_ERRORS = 1 *Session $UGREP = Weight: 1 Load: 255 $SOCKET = -1 $USER = admin $STATUS = 0 Notice in this example that there are several variables already defined in the environment. You can also display a specific variable by invoking the show variable command with a parameter that represents the variable name you want to see. For example, enter: show variable LINE The output is: $LINE = console Using Arrays A variable can hold subvalues (elements) within its memory space. Such a variable is commonly called a variable array or just an array. An array can hold numeric values, strings, or both. To create an array, simply create a variable using the set command and separate all of the array elements by spaces. For example, enter: set WeekDays "Sun Mon Tues Wed Thurs Fri Sat" You can print the array like any other variable. For example, enter: echo "Days of the week: ${WeekDays}." The output is: Days of the week: Sun Mon Tues Wed Thurs Fri Sat. 8-22 Cisco Content Services Switch Administration Guide OL-5647-02