#!/bin/sh
for i in `find /path/to/files -name "file string"`; do
mv /path/to/files/$i /path/to/files/$i.old
sed /path/to/files/$i.old 's/find string/replace with' > /path/to/files/$i
echo "Strings replaced in /path/to/files/$i"
done
I'm not sure that works, but you might try it. I just made it up.
-CJO-
On Mon, 8 Feb 1999, Jaspreet Ahuja wrote:
>Hi,
>Is there a script available that will help me search and replace a
>particular string across multiple files spanning recursive directories.
>
>thanks,
>Jaspreet.
>
>
C.J. Oster (Linux Guru/Surge Addict)
------------------------------------------------------------------
| [EMAIL PROTECTED] | 910 S. 3rd St, #1218 | CCSO, WSG, UIUC |
| [EMAIL PROTECTED] | Champaign, IL 61820 | 1443 DCL, Urbana |
------------------------------------------------------------------
(580)761-6393 (217)328-8934
"Linux, for people with an IQ above 98" - Bumper Sticker
"Hm, a little big for a cup holder... Why does it say '4x' on it?"