[ale] char replacement - repost

Robert Coggins ALE at CogginsNet.com
Wed Nov 19 10:48:49 EST 2003


Perfect Geoffrey!

Thanks for the help!

Geoffrey wrote:

> Robert Coggins wrote:
>
>> Sorry if you get this twice.  I did not ever see my post of this 
>> question from yesterday.
>>
>> Hey all,
>>
>> Is there a way to change a word(chars) in every file of a directory 
>> recursively? Similarly to using s/John/George/g in vim?
>
>
> cd TopLevelDirectoryWhereTheFilesExist
>
> for fn in $(find . -type f -print); do
>
>     sed 's/John/George/g' $fn > tmpfile
>     mv tmpfile $fn
> done
>
> Please test it as I've not. ;)
>



More information about the Ale mailing list