Re: Script editing shortcut

From: Serhat Aslan (serhatworks@gmail.com)
Date: Sat Sep 20 2008 - 11:13:34 ART


Hi Huan
 instead of using the - } { ping $i } - use this command - } { puts "
do ping $i" } -

for example: note the ips on a notebook,

192.168.1.10
192.168.1.11

then copy paste them for both scripts
Router-pinging:
 foreach i {
  x.x.x.x
} { ping $i }

Switch-macro stuff:
foreach i {
x.x.x..x
} { puts " do ping $i" }

foreach i {
192.168.1.10
192.168.1.11
} { ping $i }

foreach i {
192.168.1.10
192.168.1.11
} { puts " do ping $i" }

Serhat Aslan

On Sat, Sep 20, 2008 at 6:16 AM, Huan Pham <pnhuan@yahoo.com> wrote:

> Hi GS,
>
> I find TCL script and Switch macro very usefull for end-to-end connectivity
> testing. I can quickly collect IP addresses, and turn them into TCL script.
>
> I however do not know a quick way to convert a list of IP (which can be
> directly used for TCL), e.g.
>
> 139.1.11.1
> 139.1.15.1
> 139.1.13.1
> 150.1.1.1
> 139.1.2.2
> 139.1.25.2
> 139.1.23.2
> 150.1.2.2
> ...
>
>
> into the following text, which can be used for a Switch Macro.
>
> do ping 139.1.11.1
> do ping 139.1.15.1
> do ping 139.1.13.1
> do ping 150.1.1.1
> do ping 139.1.2.2
> do ping 139.1.25.2
> do ping 139.1.23.2
> do ping 150.1.2.2
> ...
>
>
> Notepad must have a way to "Find and Replace" a new line character with a
> new string (in this case, it's "do ping ". If we can use Notepad for this
> purpus, it would save us a lot of time editing.
>
> Any suggestions please?
>
> Thanks,
>
> Huan
>
>
> Blogs and organic groups at http://www.ccie.net
>
> _______________________________________________________________________
> Subscription information may be found at:
> http://www.groupstudy.com/list/CCIELab.html

Blogs and organic groups at http://www.ccie.net



This archive was generated by hypermail 2.1.4 : Sat Oct 04 2008 - 09:26:19 ART