EasyManua.ls Logo

MikroTik RouterOS v2.9 - Expression Grouping

MikroTik RouterOS v2.9
709 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
prefix :
action for
unnamed parameter i
pname[=value] from=1 to=10 do={:put $i}
/interface monitor-traffic ether1,ether2,ipip1
prefix /
path interface
action monitor-traffic
unnamed parameter ether1,ether2,ipip1
Expression Grouping
Description
This feature provides an easy way to execute commands from within one command level, by
enclosing them in braces '{ }'.
Notes
Subsequent script commands are executed from the same menu level as the entire script. Consider
the following example:
[admin@MikroTik] ip route> /user {
{... /ip route
{... print}
Flags: X - disabled
# NAME GROUP ADDRESS
0 ;;; system default user
admin full 0.0.0.0/0
1 uuu full 0.0.0.0/0
[admin@MikroTik] ip route>
Although the current command level is changed to /ip route, it has no effect on next commands
entered from prompt, therefore print command is still considered to be /user print.
Example
The example below demonstrates how to add two users to the user menu.
[admin@MikroTik] ip route> /user {
{... add name=x password=y group=write
{... add name=y password=z group=read
{... print}
Flags: X - disabled
# NAME GROUP ADDRESS
0 ;;; system default user
admin full 0.0.0.0/0
1 x write 0.0.0.0/0
2 y read 0.0.0.0/0
[admin@MikroTik] ip route>
Page 633 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.

Table of Contents