Get single IP from interface which have multiple IP' assigned

I have a interface which have multiple IP’s assigned. like
ether6: 1.1.1.1
ether6: 2.1.1.1

How can I get all IPs in single variable. like VAR=“1.1.1.1 2.1.1.1” or if possible just single ip ?

 /ip address get [find interface="ether6"] address

& I get this error

invalid internal item number

whole issue is, that your ****

[find interface="xxx"]

returns an array of interfaces..
All you need to do is pick one ****

/ip address get [:pick [find interface="ether6"] 0] address]

or if you want to test it in console, simply ****

:put [/ip address get [:pick [find interface="ether6"] 0] address]]



 :put [/ip address get [:pick [find interface="ether6"] 0] address]]

Thank you it worked !

well, it depends if you want to use it in script or just display value in CLI. the ****

:put

command is like an “echo” or “print” in other languages - it displays content of variable.
If its gonna be used in some script, you will most likely want to use the value in some other command, because you can’t really see what automated scripts print in console.