[NTLUG:Discuss] Re: vi editor command

Dennis Daupert ddaupert at csc.com
Thu May 22 10:31:39 CDT 2003


> "m m" <llliiilll at hotmail.com>

> Can some one help me to change a string on all files in the same
directory?
> for example:
> there are 10 files in dircetory A, all file comtain srting/world  'home',
> now I want to change 'home' to 'house' on each file. what is the
> best/quickest way to do it?

Not a vi editor command, but...
If you mean the contents of all files contains the string 'home'
you can use a perl one-liner from the command line

perl -pi -e's#\'home\'#\'house\'#g' *

/dennis

---------------------------------------------------------------------------
Office phone: 817-762-8304
---------------------------------------------------------------------------
 Everything should be made as simple as possible,
but not simpler.


----------------------------------------------------------------------------------------

This is a PRIVATE message. If you are not the intended recipient, please
delete without copying and kindly advise us by e-mail of the mistake in
delivery. NOTE: Regardless of content, this e-mail shall not operate to
bind CSC to any order or other contract unless pursuant to explicit written
agreement or government initiative expressly permitting the use of e-mail
for such purpose.
----------------------------------------------------------------------------------------







More information about the Discuss mailing list