JUNOSe 11.1.x System Basics Configuration Guide
Table 53: Operator Actions (continued)
Assignment
Use the assignment operator (:=) to set the value of a local variable. The expression
to the right of the operator is evaluated, and then the result is assigned to the local
variable to the left of the operator. The expression to the right of the operator can
include the local variable if you want to modify its current value.
Example
<# i := i + 1 #>
<# count := count - 2 #>
Increment and Decrement
You can use the increment operator (++) to increase the value of a local variable
by one. You specify when the value is incremented by the placement of the operator.
Incrementing occurs after the expression is evaluated if you place the operator to
the right of the operand. Incrementing occurs before the expression is evaluated if
you place the operator to the left of the operand.
482
Writing Macros
Operation
Operator
Modulo
%
Postincrement
++
Postdecrement
– –
Preincrement
++
Predecrement
– –
Negation
!
Arithmetic (unary)
+
Arithmetic (unary)
–
Substring
substr()
Randomize
rand()
Round
round()
Truncate
truncate()
Action
Divides the expression to the left of the operator by the
expression to the right and returns the integer
remainder. If the expression to the left of the operator
is less than the expression to the right, then the result
is the expression to the left of the operator.
Increments the variable after the expression is evaluated
Decrements the variable after the expression is evaluated
Increments the variable before the expression is
evaluated
Decrements the variable before the expression is
evaluated
Reverses the logical state of its operand. 0 is returned
for nonzero operands. 1 is returned for operands that
evaluate to zero.
Provides the absolute value of the value
Provides the inverse of the value
Extracts a portion of a string
Generates a random integer between the provided
endpoints, inclusive
Rounds the value to the nearest integer
Truncates a noninteger value to the value left of the
decimal point
Need help?
Do you have a question about the SYSTEM BASICS - CONFIGURATION GUIDE V 11.1.X and is the answer not in the manual?
Questions and answers