X-Recipient: archive-cygwin@delorie.com
X-Spam-Check-By: sourceware.org
To: cygwin@cygwin.com
From: Matthew Woehlke <mw_triad@users.sourceforge.net>
Subject:  Re: find . -regex '.*js' -type f -exec md5sum '{}' \\; really slow!
Date:  Mon, 24 Nov 2008 11:46:22 -0600
Lines: 25
Message-ID: <ggep9e$f5l$1@ger.gmane.org>
References:  <1227540449.7201.45.camel@LxPC35> 	 <F0D7281DAB048B438E8F5EC4ECEFBDDC0337DE68@esmail.elsag.de> 	 <1227542582.7201.51.camel@LxPC35> <1227542941.7201.55.camel@LxPC35>
Mime-Version:  1.0
Content-Type:  text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding:  7bit
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.8.1.16) Gecko/20080723 Fedora/2.0.0.16-1.fc9 Thunderbird/2.0.0.16 Mnenhy/0.7.5.0
In-Reply-To: <1227542941.7201.55.camel@LxPC35>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
Precedence: bulk
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie.com@cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

Bartolomeo Nicolotti wrote:
> but the command
> 
> find . -type f  | xargs md5sum
> 
> has problems with blanks in the name of the files:
> [snip examples]

find . -type f -print0 | xargs -0 md5sum

...tells find to output \0-separated lines instead of \n-separated 
lines, and tells xargs to expect \0-separated args instead of 
whitespace-seoarated args.

(That said, I've always rather wondered why xargs doesn't have a mode to 
expect \n-separated args. There is of course the problem that file names 
might also contain \n (maybe not on 'doze, but on POSIX filesystems they 
can), though for less typing it seems most xargs input tends to be 
line-delineated anyway.

-- 
Matthew
Please do not quote my e-mail address unobfuscated in message bodies.
-- 
Is this thing on?


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

