X-Recipient: archive-cygwin AT delorie DOT com X-Spam-Check-By: sourceware.org To: cygwin AT cygwin DOT com From: Matthew Woehlke Subject: Re: find . -regex '.*js' -type f -exec md5sum '{}' \\; really slow! Date: Mon, 24 Nov 2008 11:46:22 -0600 Lines: 25 Message-ID: References: <1227540449 DOT 7201 DOT 45 DOT camel AT LxPC35> <1227542582 DOT 7201 DOT 51 DOT camel AT LxPC35> <1227542941 DOT 7201 DOT 55 DOT camel AT 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 AT cygwin DOT com; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT 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/