Community discussions

MikroTik App
 
DeCr0pt
just joined
Topic Author
Posts: 12
Joined: Wed Aug 02, 2017 1:21 pm

[possible bug] interface id from variable is different

Thu Aug 03, 2017 4:58 pm

Hello, i have simple script :local getid [/interface get [find name=ether2] id] normally when i check it via /interface print i see id 1 but when i make :put $getid i got id 6, of course i can use something like a ($getid -5) but i dont want use it because on my testing CHR is this working fine, what it is? I m using latest 6.40 of routeros
 
msatter
Forum Guru
Forum Guru
Posts: 2941
Joined: Tue Feb 18, 2014 12:56 am
Location: Netherlands / Nīderlande

Re: [possible bug] interface id from variable is different

Thu Aug 03, 2017 9:37 pm

Number one is the position in the list and ID is the hexadecimal location of the real position in the list. So you have different vectors for the same line.
 
DeCr0pt
just joined
Topic Author
Posts: 12
Joined: Wed Aug 02, 2017 1:21 pm

Re: [possible bug] interface id from variable is different

Thu Aug 03, 2017 10:00 pm

Thanks for info, and how i can get number of position in list? Is possible to use like in unix system /interface print | grep ether2 | awk '{print $1}' ?
 
msatter
Forum Guru
Forum Guru
Posts: 2941
Joined: Tue Feb 18, 2014 12:56 am
Location: Netherlands / Nīderlande

Re: [possible bug] interface id from variable is different

Fri Aug 04, 2017 11:40 am

I was wrong on this and I was looking at the general ID and this one is specific for interfaces.

https://wiki.mikrotik.com/wiki/Manual:Interface
 
DeCr0pt
just joined
Topic Author
Posts: 12
Joined: Wed Aug 02, 2017 1:21 pm

Re: [possible bug] interface id from variable is different

Fri Aug 04, 2017 12:49 pm

I rewrite my script to work just only with name of interface, but it will be good to have something to grep id of interface via get. But thanks anyway

Who is online

Users browsing this forum: abdolali and 5 guests