www.delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2003/07/07/20:20:22

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Message-Id: <5.2.1.1.2.20030707171122.0206bd98@pop.sonic.net>
X-Sender: rschulz AT pop DOT sonic DOT net
Date: Mon, 07 Jul 2003 17:20:48 -0700
To: cygwin AT cygwin DOT com
From: Randall R Schulz <rschulz AT sonic DOT net>
Subject: Re: find -exec oddity
In-Reply-To: <3F0A045D.7030009@alltel.net>
Mime-Version: 1.0

Ken,

At 16:38 2003-07-07, Ken Dibble wrote:
>Ok, I'm an idiot.  I've looked in the FAQ, searched the mail lists
>and checked sundry Unix sources (no, not the source code).

Well, I doubt greatly that you're an idiot. Confusion is the prelude to 
enlightenment, after all...

(Compare that with Eudora whose "mood watch" feature seems to think the 
first sentence of the previous paragraph is some kind of insult!)


However, we'd all appreciate it if you'd figure out how to use your 
mail client to make sure text attachments are not placed in-line with 
the message content. Not to do so defeats the purpose of attaching the 
"cygcheck" output, which is to make list searching meaningful by 
preventing the false hits that occur because of all the package and 
file names that are included in the cygcheck output.


>I can't make sense of this.
>
>$ find ./ -mtime -1  -print | wc -l
>    55
>
>$ find ./ -mtime -1 -ls | wc -l
>    55
>
>$ find ./ -mmin -1440 -ls | wc -l
>    55
>
>$ find ./ -mtime -1  -exec ls -l  '{}' \; | wc -l
>  2046

Look carefully at the man page for find where the "-ls" option is 
described. It says that "-ls" is equivalent to running "ls" with the 
options "-dils". The salient option here is "-d" which suppresses the 
listing of a directory's contents when a directory is an explicit 
argument to ls. You're not including "-d" in your invocation of ls, so 
every directory produced by find contributes its entire contents to the 
output of ls that is subsequently counted by "wc -l".


>$ find ./ -mtime -1  -exec ls -l  {} \; | wc -l
>  2046
>
>$ find ./ -mmin -1440  -exec ls -l  {} \; | wc -l
>  2046
>
>
>and just for grins....
>
>$ find ./ -print | wc -l
>31701
>
>$ find ./ -mtime -10 -print | wc -l
>   285
>
>$ find ./ -mtime -100 -print | wc -l
>15590
>
>The oddity (bug?) appears to be tied to -exec somehow.

No. The "-exec" option is doing just what you ask and just what it should.


>Attached is cygcheck -c -v -s.

As above.


>I can't attach the file lists (unpiped find output) as the message 
>size then exceeds 100K and the redhat mailserver bounces it.

No matter. It's not needed.


>Any help would be appreciated.

I hope my assumption about the problem is correct (file count 
discrepancies), since you didn't really say what it was that perplexed you.


>thanks,
>Ken


Randall Schulz 


--
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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019