Chris Rodliffe wrote:
> 
> I have a query - is there any cunning way (using  grep or some similar
> command)  to replace a short text string in all the files in a directory
> with another specified string?    I know many things are possible with
> Linux, just wondering if that is?
> 

        something like:

        find -type f -iname '*.c' -exec perl -i~ -p -e 's/suxx/rulezz/ig' {} \;

        will recursively replace word 'suxx' with 'rulezz' in all c files starting 
from current directory leaving a backup copy of each processed file in file with 'c~' 
extension.

        instead of perl can be used anything with enabled batch/macro processing - vim 
for example.
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.linux-learn.org/faqs

Reply via email to