script help
Jack L. Stone
jacks at sage-american.com
Tue Feb 15 15:55:46 UTC 2011
At 02:53 PM 2/15/2011 +0000, RW wrote:
>On Tue, 15 Feb 2011 12:57:12 +0300
>Peter Andreev <andreev.peter at gmail.com> wrote:
>
>> Use of "xargs" on many files will be much faster than "find...exec"
>> construction
>
>This is a surprisingly common myth. exec can pass single or multiple
>arguments according to whether you use ";" or "+"
>>
>> find / -type f -name copyright.htm | xargs sed -i .bak -e
>> 's/2010/2011/g'
>
>This is much less safe on FreeBSD than it is with the GNU versions
>because print0 is required for paths with spaces.
>
>find ... -print0 | xargs -0 ...
>
>
Forgot to mention: if the string to replace on the text line of the files
includes a connecting dash, like 1988-2010, I suppose rather than using
just the "2010/2011" perhaps should be "1988-2010/1988-2011"
Jack
(^_^)
Happy trails,
Jack L. Stone
System Admin
Sage-american
More information about the freebsd-questions
mailing list