1833875 Members
2744 Online
110063 Solutions
New Discussion

vi

 
SOLVED
Go to solution
Michael_33
Regular Advisor

vi

Hi,

There is a file called abc.
I want to replace all gif with png in this file
How can I do? sed?

Thanks!
4 REPLIES 4
Alexander M. Ermes
Honored Contributor
Solution

Re: vi

Hi there.
Try this :

esc:1,$s/gif/png/

This should do it.
Rgds
Alexander M. Ermes
.. and all these memories are going to vanish like tears in the rain! final words from Rutger Hauer in "Blade Runner"
Animesh Chakraborty
Honored Contributor

Re: vi

hi,
Do
vi abc


:1,$s/gif/png/g

Did you take a backup?
Kenny Chau
Trusted Contributor

Re: vi

When you vi that file, press "ESC" and then type:

:%s/gif/png/g

and press enter. Then you save and quit the file.

Hope this helps.
Kenny.
Kenny
Michael_33
Regular Advisor

Re: vi

Thanks All! That works perfect! : )