bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: find . -path '*/.gork' -prune -o -type f : prints ".gork"


From: David M. Karr
Subject: Re: find . -path '*/.gork' -prune -o -type f : prints ".gork"
Date: 03 Nov 2000 16:03:08 -0800
User-agent: Gnus/5.0807 (Gnus v5.8.7) Emacs/20.6

>>>>> "Bob" == Bob Proulx <address@hidden> writes:
  >> find . -path '*/.gork' -prune -o -type f
  >> 
  >> I would expect it to just print "testdir/subdir/foo".  The "find" man
  >> page gave me this impression in the description of the "-path"
  >> option.  However, it also prints "testdir/.gork".  It didn't print
  >> "testdir/.gork/stuff", but it did print the ".gork" directory entry.
  >> How can I make "find" not even print the directory entry for ".gork"
  >> (without piping it into a "grep -v" command)?

  Bob> Perhaps you could try using an explicit -print argument.  The -print
  Bob> is a default if you don't specify it.  If you do specify it then it
  Bob> applies exactly as you asked for it.  This is relatively new
  Bob> functionality for find which in the past has not made that assumption
  Bob> and would print nothing at all unless you specifically asked for it.
  Bob> There might be dragons in the area of defaulting to printing.  Better
  Bob> to be explicit.

  Bob>   find . -path '*/.gork' -prune -o -type f -print

This is really strange.  As you describe, without the "-print" on the
end, it prints the directory name I wanted to skip.  With "-print" on
the end, it doesn't print that directory.  That's the behavior that I
want.  Is it possible to explain WHY it works this way without
confusing me even more?

-- 
===============================================================================
David M. Karr     ; address@hidden  ; w:(425)487-8312 ; TCSI & Best Consulting
Software Engineer ; Unix/Java/C++/X ; BrainBench CJ12P (#12004)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]