replace configuration pattern

Function

The replace configuration pattern command replaces the source character string with the target character string.

Format

replace configuration pattern src-string with target-string

Parameters

Parameter Description Value
src-string

Specifies the source character string.

The value is a string of 1 to 32 case-sensitive characters, including letters, digits, hyphens (-), and underscores (_). Spaces are not supported.Support regular expressions.

with

Replaces <expression> with <target-string>.

-

target-string

Specifies the target character string.

The value is a string of 1 to 64 case-sensitive characters, including letters, digits, hyphens (-), and underscores (_). Spaces are not supported.

Views

All views except the user view

Default Level

3: Management level

Task Name and Operations

Task Name Operations
cli debug

Usage Guidelines

Usage Scenario

To replace a character or a type of character on a device, run the replace configuration pattern command. The command supports batch replacement.

Follow-up Procedure

After character replacement is complete, the configuration file enters the candidate configuration database. Run the commit command for relevant configurations to take effect.

Precautions

This function is supported only in the two-phase configuration validation mode.

This function replaces only the character strings in the current view.

This command can only be used to replace a single command keyword or parameter.

Example

# Replace "huawei" with "huawei123".
<HUAWEI> system-view
[~HUAWEI] replace configuration pattern huawei with huawei123
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >