From: Brian Dennis (bdennis@internetworkexpert.com)
Date: Sun Dec 10 2006 - 22:27:02 ART
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, CCIE4 #2210 (R&S/ISP-Dial/Security/SP)
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
Danny Cox
Sent: Sunday, December 10, 2006 4:25 PM
To: Nick Griffin
Cc: Cisco certification
Subject: Re: Re: Automating TCL script in routers
Ahh .. that's interesting.
I've found that sometimes when I've done some tcl work, route-map set
commands just echo what I've set to the screen instead of setting the
variable/tag/whatever. If I exit config mode, do a tclquit, and go
back again, it seems to resolve it. Anyone found this, or found
another way around it?
cheers
Danny
On 10/12/06, Nick Griffin <nick.jon.griffin@gmail.com> wrote:
> Any way to keep that stored in memory or the like, so when you do a
tclquit,
> and later perfrom tcl tests again it is still available?
>
> R1(tcl)#proc ping_all {} {
> +>(tcl)#foreach address {
> +>(tcl)#192.168.72.2
> +>(tcl)#192.168.72.7
> +>(tcl)#192.168.46.6
> +>(tcl)#192.168.46.4
> +>(tcl)#} { ping $address} }
>
> R1(tcl)#ping_all
>
> Type escape sequence to abort.
> Sending 5, 100-byte ICMP Echos to 192.168.72.2, timeout is 2 seconds:
> !!!!!
> Success rate is 100 percent (5/5), round-trip min/avg/max = 60/61/68
ms
> Type escape sequence to abort.
> Sending 5, 100-byte ICMP Echos to 192.168.72.7, timeout is 2 seconds:
> !!!!!
> Success rate is 100 percent (5/5), round-trip min/avg/max = 56/59/60
ms
> Type escape sequence to abort.
> Sending 5, 100-byte ICMP Echos to 192.168.46.6, timeout is 2 seconds:
> !!!!!
> Success rate is 100 percent (5/5), round-trip min/avg/max =
112/118/132 ms
> Type escape sequence to abort.
> Sending 5, 100-byte ICMP Echos to 192.168.46.4, timeout is 2 seconds:
> !!!!!
> Success rate is 100 percent (5/5), round-trip min/avg/max =
116/116/120 ms
> R1(tcl)#tclquit
> R1#tclsh
> R1(tcl)#ping_all
> invalid command name "ping_all" ^
> % Invalid input detected at '^' marker.
>
> Thanks!
>
> On 12/9/06, Brian Dennis <bdennis@internetworkexpert.com> wrote:
> >
> > As far as reusing the script goes have you tried using a procedure?
> >
> > Rack1R4#tclsh
> > Rack1R4(tcl)#proc ping_all {} {
> > +>foreach address {
> > +>192.168.1.1
> > +>192.168.2.2
> > +>192.168.3.3
> > +>} { ping $address} }
> >
> > Rack1R4(tcl)#ping_all
> >
> > Type escape sequence to abort.
> > Sending 5, 100-byte ICMP Echos to 192.168.1.1, timeout is 2 seconds:
> > !!!!!
> > Success rate is 100 percent (5/5), round-trip min/avg/max =
120/120/120
> > ms
> > Type escape sequence to abort.
> > Sending 5, 100-byte ICMP Echos to 192.168.2.2, timeout is 2 seconds:
> > !!!!!
> > Success rate is 100 percent (5/5), round-trip min/avg/max = 60/60/60
ms
> > Type escape sequence to abort.
> > Sending 5, 100-byte ICMP Echos to 192.168.3.3, timeout is 2 seconds:
> > !!!!!
> > Success rate is 100 percent (5/5), round-trip min/avg/max = 60/60/60
ms
> > Rack1R4(tcl)#
> > Rack1R4(tcl)#ping_all
> >
> > Type escape sequence to abort.
> > Sending 5, 100-byte ICMP Echos to 192.168.1.1, timeout is 2 seconds:
> > !!!!!
> > Success rate is 100 percent (5/5), round-trip min/avg/max =
116/118/120
> > ms
> > Type escape sequence to abort.
> > Sending 5, 100-byte ICMP Echos to 192.168.2.2, timeout is 2 seconds:
> > !!!!!
> > Success rate is 100 percent (5/5), round-trip min/avg/max = 56/59/60
ms
> > Type escape sequence to abort.
> > Sending 5, 100-byte ICMP Echos to 192.168.3.3, timeout is 2 seconds:
> > !!!!!
> > Success rate is 100 percent (5/5), round-trip min/avg/max = 56/59/60
ms
> > Rack1R4(tcl)#
> >
> >
> >
> > Brian Dennis, CCIE4 #2210 (R&S/ISP-Dial/Security/SP)
> > 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
> > Radioactive Frog
> > Sent: Saturday, December 09, 2006 3:28 PM
> > To: Cisco certification
> > Subject: Automating TCL script in routers
> >
> > Hi Gang,
> >
> > Is it possible to automate a TCL script in Cisco Routers?
> > For example:
> >
> > If I saved in router and should run after every 10 minutes?
> >
> >
> >
> > Frog.
> >
> >
This archive was generated by hypermail 2.1.4 : Tue Jan 02 2007 - 07:50:37 ART