[NTLUG:Discuss] vi editor command

Victor Brilon victor at vail.net
Thu May 22 07:30:15 CDT 2003


Well it's not vi, but it's easier...

perl -pi -e 's/home/house/g' /path/to/files/*

This will make the substitution on all files in the "/path/to/files" 
dir. Adjust according to your needs of course.

Victor

m m wrote:
> Hi all:
> 
> 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?
> 
> thanks
> 
> _________________________________________________________________
> The new MSN 8: advanced junk mail protection and 2 months FREE* 
> http://join.msn.com/?page=features/junkmail
> 
> 
> _______________________________________________
> https://ntlug.org/mailman/listinfo/discuss
> 




More information about the Discuss mailing list