RE: TCL script

From: Brian Dennis (bdennis@internetworkexpert.com)
Date: Wed Sep 20 2006 - 12:43:43 ART


The router isn't doing weird things when the TCL shell is active. Any
command that is typed will be parsed by the TCL shell before the IOS.
In the case you mentioned the "set" command is both a TCL and IOS
command. This means that if you issue the set command when the TCL
shell is active, the TCL shell will process the set command and since
it's handled by the TCL shell it's not passed to the IOS.

Rack1R1#tclsh
Rack1R1(tcl)#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Rack1R1(config)#route-map TEST
Rack1R1(config-route-map)#set interface f0/0
f0/0
Rack1R1(config-route-map)#do sho run | be route-map
route-map TEST permit 10
!
!
<snip>
Rack1R1(config-route-map)#set interface f0/0
f0/0
Rack1R1(config-route-map)#puts $interface
f0/0

Rack1R1(config-route-map)#do tclquit
Rack1R1(config-route-map)#set interface f0/0
Rack1R1(config-route-map)#do sho run | be route-map
route-map TEST permit 10
 set interface FastEthernet0/0
!
!
<snip>
Rack1R1(config-route-map)#

HTH,

Brian Dennis, CCIE #2210 (R&S/ISP-Dial/Security)
bdennis@internetworkexpert.com

Internetwork Expert, Inc.
http://www.InternetworkExpert.com
Toll Free: 877-224-8987
Direct: 775-745-6404 (Outside the US and Canada)

-----Original Message-----
From: nobody@groupstudy.com [mailto:nobody@groupstudy.com] On Behalf Of
Leo Boulton
Sent: Wednesday, September 20, 2006 5:55 AM
To: Fabio Rodrigues
Cc: Naveed Khan; ccielab@groupstudy.com
Subject: Re: TCL script

Fabio:
A typical TCL script for pinging sevearl IPs is:

R# tclsh
R(tclsh)# for each i {
192.168.1.1
192.168.1.2
192.168.1.3
200.1.2.3
200.1.2.4
} { puts [ exec "ping $i"]}

However, I have to mention a disclaimer. When you enter the tclsh mode,
the router will accept other commands, but sometimes would do weird
stuff with those commands. For example, on some IOS versions, if you
configure a Route-Map with match and set statements under the tclsh#
prompt, the set statements will not show up on the running config.
Therefore you have to be very cautios when using tcl scripts. Make sure
you exit the tclsh mode before entering commands.

-LB

On 9/19/06, Fabio Rodrigues <fleandror2@gmail.com> wrote:
>
> Notepad and Windows Calculator are allowed.
>
> Does anyone have a good TCL that can share ?
>
> Tks.
>
> ----- Original Message -----
> From: "Naveed Khan" <naveed_k@hotmail.com>
> To: <ccielab@groupstudy.com>
> Sent: Tuesday, September 19, 2006 11:37 PM
> Subject: TCL script
>
>
> > Hello
> > Please let me know in lab exam notepad is allowed? If is not allowed

> > how could cut and paste tcl script on all routers and switches.
> > Naveed
> >
> > ____________________________________________________________________
> > ___ Subscription information may be found at:
> > http://www.groupstudy.com/list/CCIELab.html
>
> ______________________________________________________________________
> _ Subscription information may be found at:
> http://www.groupstudy.com/list/CCIELab.html



This archive was generated by hypermail 2.1.4 : Sun Oct 01 2006 - 16:55:41 ART