Variables; Literals - Juniper SYSTEM BASICS - CONFIGURATION GUIDE V 11.1.X Configuration Manual

System basics configuration guide software for e series broadband services routers
Table of Contents

Advertisement

When you run the macro, the error command is blank and the error status is Status
is not available:

Variables

A local variable enables you to store a value used by the macro while it executes.
The macro can modify the value during execution. Local variables can be integers,
real numbers, or strings. The initial value of local variables is zero.
Like macros, local variables must have a name consisting only of letters, numbers,
or the underline character (_). The variable name must not begin with a number.
You must not use a reserved keyword as a variable name. A line that ends with a
variable needs a new line character at the end of the line.

Literals

A literal is an exact representation of numeric or string values. Every number is a
literal. Place single or double quotation marks around a string to identify it as a string
literal. You can specify special characters within a literal string by prefacing them
with a backslash as follows:
Examples
42
98.6
'string literal'
<# "error: " $ env.getErrorCommand $ "\n" #>
<# "status: " $ env.getErrorStatus $ "\n\n" #>
<# endsetoutput #>
<#endtmpl#>
ERX-40-4a-cc#macro b.mac errorStatusTest
Macro 'errorStatusTest' in file 'b.mac' starting execution (Id: 17)
error:
status: "Macro is not onError. Status is not available"
Macro 'errorStatusTest' in file 'b.mac' ending execution (Id: 17)
quotation mark
double quotation
mark
tab
carriage return
new line
string end
backslash
\'
\"
\t
\r
\n
\0
\\
Chapter 8: Writing CLI Macros
479
Writing Macros

Advertisement

Table of Contents
loading

This manual is also suitable for:

Junose 11.1

Table of Contents