cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
400
Views
0
Helpful
0
Replies

Interactive TCL Error

I have a Nexus 5548UP on version 7.0.5(N1(1).  In interactive TCL shell, a search through a list is not finding an element in the list.  Any ideas?

set VLAN_MATCH_LIST {}
lappend VLAN_MATCH_LIST 102
lappend VLAN_MATCH_LIST 122
lappend VLAN_MATCH_LIST 232
lappend VLAN_MATCH_LIST 242
lappend VLAN_MATCH_LIST 243
lappend VLAN_MATCH_LIST 246
lappend VLAN_MATCH_LIST 259
lappend VLAN_MATCH_LIST 283
lappend VLAN_MATCH_LIST 286
lappend VLAN_MATCH_LIST 288
lappend VLAN_MATCH_LIST 334
lappend VLAN_MATCH_LIST 341
lappend VLAN_MATCH_LIST 346
lappend VLAN_MATCH_LIST 356
lappend VLAN_MATCH_LIST 358
lappend VLAN_MATCH_LIST 373

puts "List: $VLAN_MATCH_LIST
Found item 122 at index [lsearch VLAN_MATCH_LIST 122]"

When I run that in an interactive session, the last two lines output are:

List: 102 122 232 242 243 246 259 283 286 288 334 341 346 356 358 373
Found item 122 at index -1

Why is it not finding list element matching "122" at index 1?

CreatePlease to create content
Content for Community-Ad
August's Community Spotlight Awards