ON THIS PAGE
replace-pattern
Usage
<rpc> <load-configuration> <!-- replace a pattern globally --> <configuration replace-pattern="pattern1" with="pattern2" [upto="n"]> </configuration> <!-- replace a pattern at a specific hierarchy level --> <configuration> <!-- opening tag for each parent element --> <level-or-object replace-pattern="pattern1" with="pattern2" [upto="n"]/> <!-- closing tag for each parent element --> </configuration> <!-- replace a pattern for an object that has an identifier --> <configuration> <!-- opening tag for each parent element --> <container-tag replace-pattern="pattern1" with="pattern2" [upto="n"]> <name>identifier</name> </container-tag> <!-- closing tag for each parent element --> </configuration> </load-configuration> </rpc>
Description
Replace a variable or identifier in the candidate
configuration or open configuration database. Junos OS replaces the
pattern specified by the replace-pattern
attribute with the replacement pattern defined by the with
attribute. The optional upto
attribute limits the number of objects replaced. The scope of the
replacement is determined by the placement of the attributes in the
configuration data.
Attributes
replace-pattern="pattern1" |
Text string or regular expression that defines the identifiers or values you want to match. |
with="pattern2" |
Text string or regular expression that replaces the identifiers and values located with pattern1. |
upto="n" |
Number of objects replaced. The value
of n controls the total number of objects that
are replaced in the configuration (not the total number of times the
pattern occurs). Objects at the same hierarchy level (siblings) are
replaced first. Multiple occurrences of a pattern within a given object
are considered a single replacement. If you do not include the
|
Release Information
Attribute introduced in Junos OS Release 15.1R1.