On Wed, May 01, 2002 at 01:42:44PM -0500, Joi Ellis wrote:
>   find . -type f -name 'Root' | \
>      xargs perl -pi.bak -e 's/localhost/some.hostname/'
> [...]
> I prefer using perl rather than a 'cp' because some of our modules
> are nested and I don't trust the Root file to be identical all
> through the tree.  Maybe they are, maybe they aren't.

Agreed.

> It also makes it easier to repair damage should some foolish programmer
> have a file named 'Root' with other content.

The way to guard against that is to be more careful with the
first, "selection", part of the pipeline, rather than the last,
"action" part:
        find . -type f -print | grep '/CVS/Root$' | xargs [whatever]

The "whatever" can be perl, cp, or anything else that makes sense
(though I typically use perl, as shown above).

--

|  | /\
|-_|/  >   Eric Siegerman, Toronto, Ont.        [EMAIL PROTECTED]
|  |  /
Anyone who swims with the current will reach the big music steamship;
whoever swims against the current will perhaps reach the source.
        - Paul Schneider-Esleben

_______________________________________________
Info-cvs mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/info-cvs

Reply via email to