![Juniper JUNOSE 11.3 Скачать руководство пользователя страница 490](http://html1.mh-extra.com/html/juniper/junose-11-3/junose-11-3_configuration-manual_2032852490.webp)
and macro end statements, and
while
loops. A control expression can include multiple
operation statements if you separate the statements with semicolons (;). For example:
<# i:=0; while i++ < 3 #>
All macros must have names consisting only of letters, numbers, and the underline
character (_). The first character of a macro name cannot be a number. If you include
more than one macro within a macro file, each macro must have a unique name. The
first line of a macro defines the macro’s name:
<#
macroName
#>
Noncontrol expressions are not enclosed by control brackets and simply become part
of the generated CLI command text.
You must end all macros with the following control expression:
<# endtmpl #>
You can add comments to your control expressions to clarify the code by prefacing the
comment with forward slashes (//) inside the control brackets:
<# endtmpl //A comment in the macro end expression #>
Text after the // is ignored when the macro is run and is not displayed by the CLI.
You can also add comments outside the control expressions by prefacing the comment
with an exclamation point (!). The CLI displays these comments if you use the
test
or
verbose
keywords with the
macro
command; the CLI never interprets these comments
as commands.
!This is a comment outside any control expression
You can improve the readability of a macro by using tabs to indent expressions. Leading
and trailing tabs have no effect on the macro output, because they are removed when
the macro is run.
Example
The following is a simple macro that you can use to configure the IP interface on the Fast
Ethernet port of the SRP module after you have restored the factory defaults:
<# ipInit #>
<# ipAddress := env.getline (“ IP Address of System?” ) #>
ena
conf t
int f0/0
ip addr <# ipAddress; ‘\n’ #>
ip route 10.0.0.0 255.0.0.0 192.168.1.1
host pk 10.10.0.166 ftp
<# endtmpl #>
Environment Commands
Macros use environment commands to write data to the macro output, to determine a
value, or to call other commands. Table 51 on page 461 describes the environment
commands that are currently supported.
Copyright © 2010, Juniper Networks, Inc.
460
JunosE 11.3.x System Basics Configuration Guide
Содержание JUNOSE 11.3
Страница 6: ...Copyright 2010 Juniper Networks Inc vi...
Страница 8: ...Copyright 2010 Juniper Networks Inc viii JunosE 11 3 x System Basics Configuration Guide...
Страница 24: ...Copyright 2010 Juniper Networks Inc xxiv JunosE 11 3 x System Basics Configuration Guide...
Страница 32: ...Copyright 2010 Juniper Networks Inc 2 JunosE 11 3 x System Basics Configuration Guide...
Страница 146: ...Copyright 2010 Juniper Networks Inc 116 JunosE 11 3 x System Basics Configuration Guide...
Страница 166: ...Copyright 2010 Juniper Networks Inc 136 JunosE 11 3 x System Basics Configuration Guide...
Страница 432: ...Copyright 2010 Juniper Networks Inc 402 JunosE 11 3 x System Basics Configuration Guide...
Страница 488: ...Copyright 2010 Juniper Networks Inc 458 JunosE 11 3 x System Basics Configuration Guide...
Страница 524: ...Copyright 2010 Juniper Networks Inc 494 JunosE 11 3 x System Basics Configuration Guide...
Страница 554: ...Copyright 2010 Juniper Networks Inc 524 JunosE 11 3 x System Basics Configuration Guide...
Страница 566: ...Copyright 2010 Juniper Networks Inc 536 JunosE 11 3 x System Basics Configuration Guide...
Страница 588: ...Copyright 2010 Juniper Networks Inc 558 JunosE 11 3 x System Basics Configuration Guide...
Страница 613: ...PART 3 Index Index on page 585 583 Copyright 2010 Juniper Networks Inc...
Страница 614: ...Copyright 2010 Juniper Networks Inc 584 JunosE 11 3 x System Basics Configuration Guide...
Страница 632: ...Copyright 2010 Juniper Networks Inc 602 JunosE 11 3 x System Basics Configuration Guide...