Does find command distinguish small and capital letters

Am I doing something wrong with the find command or this is how it works?

Example 1: Here the find command works as expected. It removes an interface from an interface list, based on interface id

/interface list member remove [ find interface=*f00020 ]
  • the interface id starts with a small letter)

Example 2. Here find is used in a script and it doesn’t work:

[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:


[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.


[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

Do not confuse Interface name with Interface id

Thank you for taking time to reply to my question.

I am talking about interface id. When used in terminal command find works well no matter if the interface id starts with capital or small letter. When used in a script it requires only capital letters. This is my problem.

my router output
6.40.9 bugfix

/interface list member print 
Flags: X - disabled, D - dynamic 
 #   LIST                                                                INTERFACE                                                              
 0   test                                                                ether3                                                                 
 1   test                                                                ether4                                                                 
 2   test                                                                ether5

Do you have any ppp interfaces? Can you add manually via winbox an interface to a test list. Then disconnect the interface and show a /interface list member print.

this mean interface deleted and shown as unknown interface
il.png

for delete “unknown” interface from list use

/interface list member remove numbers=[ find where list=test && interface~("^\\*[A-Z]+") ]

or use this instead
2.png

I feel so lame. I spent hours on debugging a script to add/remove interfaces from a list your last post made me flash for a moment. It could have been so simple. Thank you.

Another way to do it was given to my by the support:

On-up:
:local interfaceName [/interface get $interface name]
/interface list member add interface=$interfaceName list=OPERATORS_IFs

On-down:
delay 1
:local interfaceName [:toid $interface]
/interface list member remove [find interface=$interfaceName]