“ count”
“ \t this string starts with a tab and ends with a tab \t”
Operators
You can use operators to perform specific actions on local variables or literals,
resulting in some string or numeric value. Table 52 on page 480 lists the available
macro operators in order of precedence by operation type. Operators within a given
row are equal in precedence.
Table 52: Macro Operators
OperatorsOperation Type
truncate()round()rand()substr()Extraction
$String
%/*Multiplicative
– –++–+Arithmetic
!==>=<=><Relational
!&&||Logical
:=Assignment
#><#;.( ),[ ]Miscellaneous
Table 53 on page 480 briefly describes the action performed by each operator.
Table 53: Operator Actions
ActionOperatorOperation
Adds the right and left sides together+Arithmetic (binary)
Subtracts the element to the right of the operator from
the element to the left of the operator
–Arithmetic (binary)
Evaluates the elements to the right of the operator, then
assigns that value to the local variable to the left of the
operator
:=Assignment
Creates a new string by joining the values of the right
and left sides; converts any numeric values to strings
before joining
$Combine
Evaluates as true (returns a 1) if the element to the left
of the operator is less than the expression to the right of
the operator; otherwise the result is false (0)
<Less than
480 ■ Writing Macros
JUNOSe 11.1.x System Basics Configuration Guide