Example 1: Here the find command works as expected. It removes an interface from an interface list, based on interface id
Code: Select all
/interface list member remove [ find interface=*f00020 ]
Example 2. Here find is used in a script and it doesn't work:
Code: Select all
[admin@MyRouter] > :global MyVar;
[admin@MyRouter] > :set $MyVar "*f00019";
[admin@MyRouter] > /interface list member remove [ find interface=$MyVar ]
The solution is to change the small letter in the beginning of the interface id to capital one:
Code: Select all
[admin@MyRouter] > :global MyVar;
[admin@MyRouter] > :set $MyVar "*F00019";
[admin@MyRouter] > /interface list member remove [ find interface=$MyVar ]
Additionally the IDs all interface list members are starting with capital letter. My question is how it works in example 1 and not in example 2.
Code: Select all
[admin@MyRouter] > /interface list member print
Flags: X - disabled, D - dynamic
# LIST INTERFACE
1 CUSTOM_LIST_01 *F00019
2 CUSTOM_LIST_01 *F0001A
3 CUSTOM_LIST_01 *F0001D
4 CUSTOM_LIST_01 *F0001E