Trying to write a script that does a Find for <value> OR <value>. In this instance, trying to use the same variable, just with different values.
test script is
Code: Select all
[/foreach count in=[/interface find name!=ether5] do={:put [/interface get value-name=name number=$count] }]
Code: Select all
[/foreach count in=[/interface find name!=ether5 name~"(ether|sfp|combo)"] do={:put [/interface get value-name=name number=$count] }]
The problem I have is that I want to have multiple "name!=ether5" entires, but at this time have to have multiple entires. I would have expected "&&" (and) and "||" (or) to work with the operation, but cannot get the desired output. Usually it results in the "not" variable failing.
e.g of code that works...
Code: Select all
[/foreach count in=[/interface find name!=ether5 name!=ether2 name~"(ether|sfp|combo)"] do={:put [/interface get value-name=name number=$count] }]
e.g of what I would expect to work
Code: Select all
[/foreach count in=[/interface find name!="ether5"||"ether2" name~"(ether|sfp|combo)"] do={:put [/interface get value-name=name number=$count] }]
Code: Select all
[/foreach count in=[/interface find name!="(ether5|ether2)" name~"(ether|sfp|combo)"] do={:put [/interface get value-name=name number=$count] }]
As you can well see here - the
Code: Select all
name~"(ether|sfp|combo)"