Is there a way to strip the IP address from the response leaving the netmask. I found lots of posts doing the opposite, but in the script I working with I need the netmask only.
IE.
:put [/ip add get [find interface=ether1] address]
10.10.10.1/24
:put [:pick [/ip add get [find interface=ether1] address] 2 [:find [ip add get [find interface=ether1] address] "/"]]
10.10.10.1
I need something that gives me
24
Thanks,
Mike
:foreach i
in=[find where interface=ether6]
do={:local a [get $i address];
:put [:pick $a ([:find $a “/”]+1) [:len $a]]
}
The foreach loop catches interfaces with multiple IP addresses.
(Every interface on my home router has 2 IPs or more (don’t ask))
I added the step to store address into $a because it makes the command much more readable.

Zenos Solution works, You are Great Zeno, thank You very much !!!
[1@172.16.16.1] > {
{… :foreach q in=[/queue simple find where disabled ! dynamic ] do={
{{… :local num [/queue simple get $q name ];
{{… :if ($num = 1 ) do={
{{{… :local ml [/queue simple get $q max-limit ];
{{{… :local mlp1 [:pick $ml 0 [:find $ml “/”]];
{{{… :local mlp2 [:pick $ml ([:find $ml “/”]+1) [:len $ml]];
{{{… :put (“$num – $ml – $mlp1 – $mlp2”);
{{{… }}}
1 – 256k/512k – 256k – 512k