script help

Peter Andreev andreev.peter at gmail.com
Wed Feb 16 11:38:04 UTC 2011


2011/2/15 RW <rwmaillists at googlemail.com>:
> 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 "+"

You are right, use of "+" makes "-exec" much faster. Thank you, I
didn't know about this feature.
>>
>> 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 ...
>
>
>
> _______________________________________________
> freebsd-questions at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "freebsd-questions-unsubscribe at freebsd.org"
>



-- 
--
AP


More information about the freebsd-questions mailing list