I generally use:

perl -pi -e 's/string a/string b/g' file1 file2 etc

To recurse directories, use find and xargs to supply the file list on the
command line:

find /some/dir -type f -print0 | xargs -0 perl -pi -e 's/string a/string b/g'

It would only take a few minutes to wrap that up as a single command line
utility if you do it often enough to matter.

Andrew




On Mon, 4 Aug 2003, Voytek Eymont wrote:

> what's the recommendation for a m-r-s-r tool ?
>
> I'm looking to replace multiple string pairs in some web files.
> all I need is simple 'string a' for 'string b' swap, every instance,
>
> replace ? lreplace ?
>
> Voytek Eymont
>

--

No added Sugar.  Not tested on animals.  May contain traces of Nuts.  If
irritation occurs, discontinue use.

-------------------------------------------------------------------
Andrew McNaughton           In Sydney
                            Working on a Product Recommender System
[EMAIL PROTECTED]
Mobile: +61 422 753 792     http://staff.scoop.co.nz/andrew/cv.doc



-- 
SLUG - Sydney Linux User's Group - http://slug.org.au/
More Info: http://lists.slug.org.au/listinfo/slug

Reply via email to