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 15:12:56 +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 #3, bug #23920 (project findutils):

Huh?  -path was added for POSIX 200x; in draft 5.1, it is line 89102.  At any
rate, based on line 89051 ("Each path operand shall be evaluated unaltered as
it was provided, including all trailing <slash> characters; all pathnames for
other files encountered in the hierarchy shall consist of the concatenation of
the current path operand, a <slash> if the current path operand did not end in
one, and the filename relative to the path operand. The relative portion shall
contain no dot or dot-dot components, no trailing <slash> characters, and only
single <slash> characters between pathname components."), I argue that the
following behavior should occur:

$ find 2008/ 2001/ -path 2008/ -o -path 2001
2001/
2008/
(ie. the pattern '2008/' should match the argument '2008/', and the pattern
'2001' should match the argument '2001/')

$ find 2008 2001 -path 2008/ -o -path 2001
2001
(ie. the pattern '2008/' does not match the argument '2008')

I also argue that:
$ find . -path ./src/emacs/

will match for files within src/emacs (after all, the pattern './src/emacs/'
matches the file './src/emacs/foo.c', according to globbing), but:

$ find . -path ./src/emacs/ -prune

is worthless, since './src/emacs/' does not match './src/emacs', and -prune
is only useful on directories.

Maybe it is worth warning about trailing slash unless POSIXLY_CORRECT.


    _______________________________________________________

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]