[SR-Users] loop through variables

Juha Heinanen jh at tutpro.com
Tue Nov 2 14:36:16 CET 2010


Bernhard Suttner writes:

> # define some router to use later in the script (global section)
> Mod_param(router(1), "10.10.10.1")
> mod_param(router(2), "10.10.10.2")
> mod_param(router(3), "10.10.10.3")
> Mod_param(router_count, "3")
> 
> within the different routes I want to loop through the routers like that:
> 
> $var(i)
> while($(var(i) < $var(router_count)) {
>  if ($var(router($var(i)) == src_ip") { 
>    .. do something
>   }
> }
> 
> Is that somehow possible?
> 
> Any hint or idea is appreciated!

check if htable module would help you.

-- juha



More information about the sr-users mailing list