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

Execute TCL on nexus.

sg.lee
Level 1
Level 1

I want to translate the TCL script for NXOS style. It’s working in IOS but not NXOS. 

proc find_matching_ints { cmd } {
set output [exec "show run"]
set ints [list]
set currint ""
foreach line [split $output "\n"] {
if { [regexp {^interface (.*)$} $line ignore interface] } {
set currint [string trim $interface]
}
if { [regexp "^\\s+$cmd\[\\r\\n\]?$" $line] } {
lappend ints $currint
}
}
foreach int [lsort -unique $ints] {
puts $int
}
}
find_matching_ints "bpduguard enable"

0 Replies 0

Review Cisco Networking for a $25 gift card