bug-findutils
[Top][All Lists]
Advanced

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

Re: find -name when name contains a slash


From: James Youngman
Subject: Re: find -name when name contains a slash
Date: Mon, 9 May 2005 20:08:34 +0100
User-agent: Mutt/1.3.28i

On Mon, May 09, 2005 at 10:20:26AM +0100, Avis, Ed wrote:
> % find . -name foo/bar
> 
> Actual output: nothing
> Desired output: warning: don't be silly, Unix filenames can't contain
> a slash.

Good idea.  I implemented something slightly different:-

$ ./find . -name quux/umsp
./find: warning: Unix filenames usually don't contain slashes (though pathnames 
do).  That means that '-name quux/umsp' will probably evaluate to false all the 
time on this system.  You might find the '-wholename' test more useful, or 
perhaps '-samefile'.  Alternatively, if you are using GNU grep, you could use 
'find ... -print0 | grep -FzZ quux/umsp'.

The message goes to stderr, but it's only a warning.

James.






reply via email to

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