Chapter
10
/
EDLIN
Command Reference
Replace
String
(R)
[linel][,line2][?]R[stringl]
[
CTRL
1m
[string2]
Replace
all
occurrences
of
stringl
with
string2.
The
replacement is limited to the lines between linel and line2.
Notice
that
you
must
terminate
stringl by typing I
GTRL
I []],
then
begin string2 immediately followjng the I
GTRL
I
[]]
char-
acter. Terminate
string2 by typing another I
GTRL
I []] or
I
ENTER
I.
Each time Replace finds stringl,
it
replaces the stringl
with
string2.
It
displays
the
line
in
which
it
has made a
replacement.
If
a line contains more
than
one replacement,
Replace displays
it
once
for
each occurrence.
When all occurrences of
stringl
in
the specified range
are
replaced
with
string2, the Replace command terminates,
and
the
EDLIN prompt
(*)
reappears.
? tells Replace to prompt you
with
o.
K. ? each time
it
mod-
ifies a line.
Press
y to accept
the
change. Press N to reject
it.
In
either case,
the
search continues,
starting
at
the next
occurrence.
I
I i
I l
i :
...-J
! !
J
I I
LJ
I i
\ I
L..-'
I i
'-----'
, 1
U
Notes:
•
•
•
•
•
228
If
you omit linel, Replace
starts
the search
at
the line
immediately following
the
current line;
it
stops
at
line2.
If
you omit line2, Replace continues the search to the end of
the file.
If
you omit both linel
and
line2, searching begins
at
the
line
that
immediately
follows
the
current line and ends
at
the end of the file.
If
you
omit
string2,
EDLIN
deletes
all
occurrences
of
stringl
in
the
specified line range.
If
you omit stringl and string2, EDLIN uses the most
recent
string
specified
with
a Search (or Replace) command
as
stringl,
and
the
most
recent
string
specified
in
a
Replace command as
string2.
J
I
L-
i
L....:
\ 1
i i
L.-..
J