Re: find and replace all occurance of the string from a list of files

2004-12-08 Thread Tor Hildrum
On Wed, 8 Dec 2004 15:22:39 +0530, Chandrakant Reddy <[EMAIL PROTECTED]> wrote: > Hi > >I want to replace all occurances of 'and' with '&' in all the given files In-place with backup in filename.bk: perl -pi'*.bk' -e 's/\band\b/&/g' filenames > Here the problem is the files are owned by

find and replace all occurance of the string from a list of files

2004-12-08 Thread Chandrakant Reddy
Hi I want to replace all occurances of 'and' with '&' in all the given files inputfile.txt containts all the names of the files to process. i wrote a small shell script for this for i in `cat inputfile.txt` do cp $i ${i}.bk sed -e 's/ and / & /g' ${i}.bk