{...
:put
"pick
and
nothing
commands
return
the
same
value"}
pick
and
nothing
commands
return
the
same
value
[admin@MikroTik]
>
pick - returns a range of elements or a substring depending on the type of input value ( text | ) - the
string or value list from which a substring or a subrange should be returned ( integer ) - start
position of substring or subrange ( integer ) - end position for substring or subrange
[admin@MikroTik]
>
:set
a
1,2,3,4,5,6,7,8
[admin@MikroTik]
>
:put
[:len
$a]
8
[admin@MikroTik]
>
:put
[:pick
$a]
1
[admin@MikroTik]
>
:put
[:pick
$a
0
4]
1,2,3,4
[admin@MikroTik]
>
:put
[:pick
$a
2
4]
3,4
[admin@MikroTik]
>
:put
[:pick
$a
2]
3
[admin@MikroTik]
>
:put
[:pick
$a
5
1000000]
6,7,8
[admin@MikroTik]
>
:set
a
abcdefghij
[admin@MikroTik]
>
:put
[:len
$a]
10
[admin@MikroTik]
>
:put
[:pick
$a]
a
[admin@MikroTik]
>
:put
[:pick
$a
0
4]
abcd
[admin@MikroTik]
>
:put
[:pick
$a
2
4]
cd
[admin@MikroTik]
>
:put
[:pick
$a
2]
c
[admin@MikroTik]
>
:put
[:pick
$a
5
1000000]
fghij
put - echoes supplied argument to the console ( text ) - the text to be echoed to the console
Display the MTU of ether1 interface
[admin@MikroTik]
>
:put
[/interface
get
ether1
mtu]
1500
[admin@MikroTik] >
resolve - returns IP address of the host resolved from the DNS name. The DNS settings should be
configured on the router (/ip dns submenu) prior to using this command. ( text ) - domain name to
be resolved into an IP address
DNS configuration and resolve command example
[admin@MikroTik]
ip
route>
/ip
dns
set
primary-dns=159.148.60.2
[admin@MikroTik]
ip
route>
:put
[:resolve
www.example.com]
192.0.34.166
set - assigns new value to a variable ( name ) - the name of the variable ( text ) - the new value of
the variable
Measuring time needed to resolve www.example.com
[admin@MikroTik]
>
:put
[:time
[:resolve
www.example.com
]]
00:00:00.006
[admin@MikroTik] >
time - measures the amount of time needed to execute given console commands ( text ) - the
console commands to measure execution time of
Measuring time needed to resolve www.example.com
[admin@MikroTik]
>
:put
[:time
[:resolve
www.example.com
]]
Page 643 of 695
Copyright 1999-2007, MikroTik. All rights reserved. Mikrotik, RouterOS and RouterBOARD are trademarks of Mikrotikls SIA.
Other trademarks and registred trademarks mentioned herein are properties of their respective owners.
Содержание RouterOS v2.9
Страница 1: ...MikroTik RouterOS v2 9 Reference Manual ...