Replacing Command Strings - Fujitsu XG0224 User Manual

Hide thumbs Also See for XG0224:
Table of Contents

Advertisement

XG Series User's Guide

Replacing command strings

By entering a single-replacement specifier (:s) or all-replacement specifier (:gs) following a history specifier and
replacement specifier, you can replace the target string and re-execute the command string.
A single-replacement specifier replaces the first matching string only, while an all-replacement specifier replaces all
matching strings.
The replacement target string and replacement string are specified as with string replacement for the preceding command;
however, arbitrary characters (@, #, %, &, ~, =, _, etc.) may be used as delimiters. You can successively enter a single-
replacement specifier, all-replacement specifier, and display specifier.
The table below lists specifiers and operations. This example uses "/" as a delimiter.
(A: replacement target string, B: replacement string, C: additional string)
Command
:s/A/B/
:ps/A/B/
:s/A/B/C
:ps/A/B/C
:gs/A/B/
:pgs/A/B/
:gs/A/B/C
:pgs/A/B/C
:s/A//
:ps/A//
:s/A//C
:ps/A//C
:gs/A//
:pgs/A//
:gs/A//C
:pgs/A//C
:s/A1/B1/:gs/A2/B2/:p
A command execution example is shown below.
Command
# lan 0 ip address 192.168.0.1/24 3
# !!:gs/0/1/:p
lan 1 ip address 192.168.1.1/24 3
# !!
lan 1 ip address 192.168.1.1/24 3
When entering a command with the command history function, you can omit the last delimiter (/, ^, etc.) at the end of the
Note
command line. However, when the last delimiter is omitted, you cannot specify a display specifier (:p), additional history
specifier, or additional string.
Replace only the first instance of A with B and execute the command string.
Replace only the first instance of A with B and display the command string.
Replace only the first instance of A with B, add C to the command string, and execute it.
Replace only the first instance of A with B, add C to the command string, and display it.
Replace all instances of A with B and execute the command string.
Replace all instances of A with B and display the command string.
Replace all instances of A with B, add C to the command string, and execute it.
Replace all instances of A with B, add C to the command string, and display it.
Delete only the first instance of A and execute the command string.
Delete only the first instance of A and display the command string.
Delete only the first instance of A, add C to the command string, and execute it.
Delete only the first instance of A, add C to the command string, and display it.
Delete all instances of A and execute the command string.
Delete all instances of A and display the command string.
Delete all instances of A, add C to the command string, and execute it.
Delete all instances of A, add C to the command string, and display it.
Replace only the first instance of A1 with B1, replace all instances of A2 with B2, and display the
command string.
(Replace all instances of 0 with 1 and display the command string.)
(Re-execute the last command to run.)
Operation
51
Chapter 2 Using the CLI
Using the CLI

Advertisement

Table of Contents
loading

This manual is also suitable for:

Xg0448Xg2600Xg0440dcXg0440dcr

Table of Contents