View Single Post
Old 12-05-2017, 12:04 PM
bgagnon bgagnon is offline
VanDyke Technical Support
Join Date: Oct 2008
Posts: 4,322
Hi Jack,

I am not really sure what you are trying to accomplish with this script. It seems you are making it more complicated than it needs to be.

If this is a true statement:

in it i want to replace string STM64-L1 with 10G-L100 then apply configuration to router again as string

And this is the output resulting from your Send() command (at least as much as you are capturing in the x variable):

#set policy-options policy-statement STM64-L1 term ARI from route-filter exact
  • You cannot split on a comma because there is none in the output:
  • This seems like it would be a simple replace operation:
strCommand = x.replace("STM64-L1", "10G-L100")

' Since commands don't typically begin with #, replace it also
strCommand = x.replace("#", "")

Additionally, you should be using \r (which simulates pressing Enter) not \n for the Send() commands.

VanDyke Software
Technical Support
(505) 332-5730
Reply With Quote