Does anyone have a unix script that will find a string and replace it with an other string in all the files right under the directory from where this is run...and also all the files in the subdirectories. For example, I would like to replace the word mydb1 to mydb2 in all .sh files and subdirectory files, how do i get this done? Any suggestions on this would be greatly appreciated. Thanks
Thank you Aigles. Worked perfect. If you can help me tweak this a little further, that would be wonderful.
Keeping the same thing in place ,
( find . -name '*.sh' | xargs perl -p -i'_save' -e 's/mydb1/mydb2/g' )
suppose, in place of mydb1, i want to include a string with slashes -
something like /usr/limo/bin and replace it with /usr/limo9i/bin,
how do i do this ? The reason I am doing this is because there are directory paths included within scripts and I would prefer to provide the whole path so that I don't replace anything that is unintended. Thanks a lot