Using a context search, Copying lines—the t (transfer) subcommand – HP NonStop G-Series User Manual

Page 179

Advertising
background image

line that contains only
--repeat, only--
a period.

In the 4i subcommand, you enter the new line of text and then type a period on the next line to
end the i subcommand. A second 1,$p subcommand displays the contents of the buffer again,
showing that the new text was inserted.

Using a Context Search

Another way to specify where the i subcommand inserts new lines is to use a context search. With
a subcommand of the form /string/i, you can locate the line that contains string and insert
new lines before that line. To end the i subcommand, type a period on a line by itself.
In the following example, the /period/i subcommand inserts new text before the line that contains
the string “period”:

/period/i
and in the first position--
.
1,$p
The only way to stop
adding text is to type a
line that contains only
--repeat, only--
and in the first position--
a period.

The 1,$p subcommand displays the entire contents of the buffer, showing that the i subcommand
has inserted the new text.

Copying Lines—The t (Transfer) Subcommand

With the t (transfer) subcommand, you can copy lines from one place in the buffer and insert the
copied lines elsewhere. The t subcommand does not affect the original lines. The general form of
the t subcommand is the following:

starting_line,ending_linetline_to_follow

To copy lines, enter a subcommand of the form:

n,mtx

where:

is the first line of the group to be copied.

n

is the last line of the group to be copied.

m

is the line the copied lines are to follow.

x

To copy lines to the top of the buffer, use 0 (zero) as the line number for the line to follow. To copy
lines to the bottom of the buffer, use $ as the line number for the line to follow.
In the following example, the 1,3t4 subcommand copies lines 1 through 3 and inserts the copies
after line 4:

1,3t4 1,$p
The only way to stop
adding text is to type a
line that contains only
--repeat, only--
The only way to stop
adding text is to type a
line that contains only
and in the first position--
a period.

Copying Lines—The t (Transfer) Subcommand

179

Advertising
This manual is related to the following products: