From: Tim Pease Date: 2007-05-24T04:39:48+09:00 Subject: Re: Regexp challenge On 5/23/07, James Edward Gray II wrote: > On May 23, 2007, at 11:14 AM, Casimir Pohjanraito wrote: > > > Whats the rubyest ruby program you can code for opening a directory of > > files and replacing a particular string in all files (if found) with > > another string? > > > > Lets suppose that all files in directory are text and the string to > > search > > for is "target", and replace string is "practice". > > From inside the directory in question: > > $ ruby -pi -e 'gsub("target", "practice")' * > > James Edward Gray II > And we have a winner! James you never cease to amaze me. I just learned three new things. TwP