- To: slug@xxxxxxxxxxx
- Subject: Re: [SLUG] script assistance please
- From: Peter Hardy <peter@xxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 20 Jun 2005 11:10:53 +1000
On Mon, 2005-06-20 at 11:03, David wrote:
> thanks Tony.... but the bit that is mostly tricking me is going through
> the directory recursively to get to each file. I didn't mention the
> recursive thing in my original post - there are several hundred files in
> a directory tree ( a web site).
Use find, sideshow David!
To find all regular files under /path/to/website and feed them as
arguments to the perl snippet:
find -xtype f /path/to/website | xargs perl -i -pe
's/foo.bar/bar.foo/g;s/\r/\n/g'
I haven't tested that yet. Nor have I finished my morning caffeine hit.
Your mileage will most likely vary.
--
Pete