Hi all, to make my scripts a little neater it would be great if I could save a comment in a local/global variable. However, I’ve tried this is in the shell and it doesn’t work as planned.
If I store the comment I need to find in a variable, when using it with a find, it brings back several results instead of the one I expect.
Ive included a demonstration below-
[admin@Leicester] > / ip route add dst-address=192.168.14.2 gateway=ETH03 comment=“Hello”
[admin@Leicester] > :global comment “Hello”
[admin@Leicester] > :put [ip route find comment=$comment]
*13;*1b;*1e;*1a
[admin@Leicester] > :put [ip route find comment=Hello]
*1eAny help appreciated, Thanks.
Did you use 6.10? I’m using 6.7, I re-tested and I’m still having issues. I’m hesitant to upgrade to 6.10 as it was crashing on me, but if this is a bug that has been identified and fixed by Mikrotik I guess I will have to wait for 6.11.
When testing, did you have other routes with comments?
[admin@Leicester] /ip route> add dst-address=192.168.168.0/24 gateway=1.1.1.1 comment=lala
[admin@Leicester] /ip route> :put [find comment=lala]
*20
[admin@Leicester] /ip route> :global comment “lala”
[admin@Leicester] /ip route> :put [find comment=$comment]
*13;*1b;*1a;*20
@marrold
Tested on v.6.10, your code returns IDs of all routes with comment, not only one with specific comment (e.g. ‘lala’).
You are right, it’s probably ROS bug.