This is the mail archive of the mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: find -exec oddity


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

$ find ./ -mtime -1 -ls | wc -l

$ find ./ -mmin -1440 -ls | wc -l

$ find ./ -mtime -1  -exec ls -l  '{}' \; | wc -l

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

$ find ./ -mmin -1440  -exec ls -l  {} \; | wc -l

and just for grins....

$ find ./ -print | wc -l

$ find ./ -mtime -10 -print | wc -l

$ find ./ -mtime -100 -print | wc -l

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.


Randall Schulz

-- Unsubscribe info: Problem reports: Documentation: FAQ:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]