From: Wang Dehong-DWANG1 (Dehong.Wang@motorola.com)
Date: Wed Jan 11 2006 - 20:54:55 GMT-3
thanks. it works with puts..
________________________________
From: Bajo [mailto:bajoalex@gmail.com]
Sent: Wednesday, January 11, 2006 5:48 PM
To: Wang Dehong-DWANG1
Cc: Cisco certification
Subject: Re: Tclsh question..
Try with "puts":
tclsh
!
foreach address {
150.1.1.1
150.1.2.2
150.1.3.3
150.1.4.4
150.1.5.5
150.1.6.6
150.1.7.7
150.1.8.8
204.12.1.254
192.10.1.254
54.1.7.6
54.1.7.254
} {puts [exec "ping $address"]}
tclquit
On 1/11/06, Wang Dehong-DWANG1 <Dehong.Wang@motorola.com> wrote:
Any idea why this script does not work with 12.3 release? Ping
command
just sit there and does nothing. It works with other release.
Thanks.
- Dehong
tclsh
foreach ip {
136.1.136.1
150.1.1.1
136.1.245.2
} {ping $ip}
Rack1R5#tclsh
Rack1R5(tcl)#foreach ip {
+> 136.1.136.1
+> 150.1.1.1
+> 136.1.245.2
+>} {ping $ip}
Rack1R5(tcl)#tclq
Rack1R5#dir flash:
Directory of flash:/
1 -rw- 25730484 Dec 27 2005 20:45:18 +00:00
c2600-jsx-mz.123-14.T3.bin
33030140 bytes total (7299592 bytes free)
Rack1R1#tclsh
Rack1R1(tcl)#foreach ip {
+> 136.1.136.1
+> 150.1.1.1
+> 136.1.245.2
+>} {ping $ip}
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 136.1.136.1, timeout is 2
seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max =
1/2/4 ms
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 150.1.1.1, timeout is 2
seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max =
1/1/4 ms
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 136.1.245.2, timeout is 2
seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max =
120/137/204
ms
Rack1R1#dir flash:
Directory of flash:/
1 -rw- 18309296 Mar 02 1993 11:10:19
c2600-js-mz.122-15.T16.bin
33030144 bytes total (14720784 bytes free)
Rack1R1#exit
[Connection to 150.1.1.1 closed by foreign host]
This archive was generated by hypermail 2.1.4 : Wed Feb 01 2006 - 07:45:48 GMT-3