From owner-freebsd-questions@FreeBSD.ORG Tue Feb 15 15:55:46 2011 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 98D22106566B for ; Tue, 15 Feb 2011 15:55:46 +0000 (UTC) (envelope-from jacks@sage-american.com) Received: from mail.sagedata.net (mail.sagedata.net [38.106.15.121]) by mx1.freebsd.org (Postfix) with ESMTP id 71EB28FC4C for ; Tue, 15 Feb 2011 15:55:46 +0000 (UTC) Received: from SAGEPLACE (sageweb.net [65.68.247.73]) by mail.sagedata.net (8.14.4/8.14.4) with SMTP id p1FFtjq6053476; Tue, 15 Feb 2011 09:55:45 -0600 (CST) (envelope-from jacks@sage-american.com) X-Authentication-Warning: mail.sagedata.net: Host sageweb.net [65.68.247.73] claimed to be SAGEPLACE Message-Id: <3.0.1.32.20110215095543.018c2ac8@sage-american.com> X-Sender: jacks@sage-american.com X-Mailer: Windows Eudora Pro Version 3.0.1 (32) Date: Tue, 15 Feb 2011 09:55:43 -0600 To: RW , freebsd-questions@freebsd.org From: "Jack L. Stone" In-Reply-To: <20110215145335.5f666400@gumby.homeunix.com> References: <3.0.1.32.20110214163437.019167e0@sage-american.com> <12e28896cd5.6574638108640039636.4001582758217268039@zoho.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-Greylist: Message whitelisted by Sendmail access database, not delayed by milter-greylist-4.2.6 (mail.sagedata.net [38.106.15.121]); Tue, 15 Feb 2011 09:55:45 -0600 (CST) X-Scanned-By: milter-spamc/1.15.388 (mail.sagedata.net [38.106.15.121]); Tue, 15 Feb 2011 09:55:45 -0600 X-Spam-Status: NO, hits=-10.00 required=4.50 X-Spam-Report: Content analysis details: (-10.0 points, 4.5 required) | | pts rule name description | ---- ---------------------- -------------------------------------------------- | -0.0 SHORTCIRCUIT Not all rules were run, due to a shortcircuited rule | -10 ALL_TRUSTED Passed through trusted hosts only via SMTP | Cc: Subject: Re: script help X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Feb 2011 15:55:46 -0000 At 02:53 PM 2/15/2011 +0000, RW wrote: >On Tue, 15 Feb 2011 12:57:12 +0300 >Peter Andreev 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