bug-findutils
[Top][All Lists]
Advanced

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

[bug #23920] find.1: please add short note about no trailing slashes for


From: Eric Blake
Subject: [bug #23920] find.1: please add short note about no trailing slashes for directories
Date: Sat, 06 Sep 2008 22:17:10 +0000
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.16) Gecko/20080702 Firefox/2.0.0.16 Mnenhy/0.7.5.666

Follow-up Comment #5, bug #23920 (project findutils):

Oops.  I was thinking that -path added an implicit leading and trailing *,
but that is not the case.  Just like -name, the pattern does not match an
internal substring unless explicit globs are provided.  So, revisiting the
examples:

$ find 2008/ 2001/ -path 2008/ -o -path 2001
2008/
$ find 2008/ 2001/ -path 2008/ -o -path '2001*'
2001/
2008/
$ find 2008 2001 -path 2008/ -o -path 2001
2001
$ find ./src/emacs/ -path ./src/emacs/
./src/emacs/
$ find . -path ./src/emacs/
$ find . -path './src/emacs/*'
./src/emacs/foo.c

So, indeed, a trailing slash to path will never match anything except command
line arguments, making it almost worthless for -prune.


    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?23920>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/





reply via email to

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