Environment Commands - Juniper JUNOSE SOFTWARE FOR E SERIES 11.3.X - SYSTEM BASICS CONFIGURATION GUIDE 2010-10-04 Configuration Manual

Software for e series broadband services routers system basics configuration guide
Hide thumbs Also See for JUNOSE SOFTWARE FOR E SERIES 11.3.X - SYSTEM BASICS CONFIGURATION GUIDE 2010-10-04:
Table of Contents

Advertisement

JunosE 11.3.x System Basics Configuration Guide
Example

Environment Commands

460
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.
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 #>
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.

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the JUNOSE SOFTWARE FOR E SERIES 11.3.X - SYSTEM BASICS CONFIGURATION GUIDE 2010-10-04 and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

This manual is also suitable for:

Junose 11.3

Table of Contents