TCL question

Unanswered Question
Oct 30th, 2007
User Badges:

Hi,

In tclsh I have the following command:


proc get_net { interface } {return [join [lrange [split [lindex [exec sh ip int brief $interface

| include $interface] 1] .] 0 2] .]}


and I get this error message after applying to my router:

Router(tcl)#

proc get_net { interface } {return [join [lrange [split [lindex [exec sh ip int brief $interface

+>missing close-brace


In my template, the line is complete!!!

  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 5 (1 ratings)
Loading.
Joe Clarke Tue, 10/30/2007 - 11:32
User Badges:
  • Cisco Employee,
  • Hall of Fame,

    Founding Member

This should work:


proc get_net { interface } {

return [join [lrange [split [lindex [exec "sh ip int brief $interface | include $interface"] 1] "."] 0 2] "."]

}

persepolis77 Wed, 10/31/2007 - 06:39
User Badges:

It seems that there was a space somewhere which made me trouble.

I copied the same line from another template that I had and pasted in mine and worked.

so weired though!!!

Thanks anyway.

Actions

This Discussion