Re: Vi change command second try



On Jan 28, 12:38 pm, JAW <jwill...@xxxxxxxxxxxxxxxx> wrote:
FROM:

rcp -p /u31/oradata/TTTT/rbtsxx.dbf  unix31u:/u31/oradata/TTTT/
rbtsxx.dbf

TO:

rcp -p /u31/oradata/TTTT/rbtsxx.dbf  unix31u:/u31/oradata/ZZZZ/u31/
rbtsxx.dbf

I have a large file that looks like the above in the FROM section  one
line:

Basically to get FROM and TO I used two
sets of VI commands.  I changed the first TTTT to XXXX so I could
then
work on the second one  (target) and then I change it back.

The net is I want to cahnge the second TTTT without changing the first
TTTT which is what I have always done.

How about an interactive confirmation ?.... like this:

:1,$s#TTTT#ZZZZ/u31#gc

Vi will prompt you for replacement for every occurrance
of TTTT. All you need to do is reponse with "n" for 1st
occrrence and with "y" for the 2nd accurence on each
line.
.