Guest User

Untitled

a guest
Aug 27th, 2018
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
TCL 0.41 KB | None | 0 0
  1. set runconfig [exec "show running-config"]
  2. set foundposition [string first "clock timezone" $runconfig]
  3. set cutoff [string length "clock timezone"]
  4. if {$foundposition > -1} {
  5.     set begin [expr $foundposition + $cutoff]
  6.     set end [expr $begin + 7]
  7.     set timezone [string range $runconfig $begin $end]
  8.     puts "We found the timezone!"
  9.     puts -nonewline "The current timezone is"
  10.     puts $timezone
  11. }
Add Comment
Please, Sign In to add comment