bugfindutils - Bugs: bug #23964, Conflicting assumptions about...

 
 

bug #23964: Conflicting assumptions about slashes and -name

Submitter:  James Youngman <jay>
Submitted:  Wed 30 Jul 2008 11:02:15 AM UTC
   
 
Category:  find Severity:  3 - Normal
Item Group:  Wrong result Status:  Works For Me
Privacy:  Public Assigned to:  jay
Originator Name:  Open/Closed:  Closed
Release:  None Fixed Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Wed 30 Jul 2008 12:11:40 PM UTC, comment #1: 

The second version CANNOT match anything, and if it did match something, then that is a bug.  '-name' implies that a basename search is performed, and the basename of './core.\*' is 'core.\*', regardless of whether you searched in core* or ./core*.  The reason your first version matched nothing is because core files with a literal in the name are rare, you probably meant "-name core.\" or "-name 'core.*'" in your shell quoting, rather than the overquoted "-name 'core.\*'".

In fact, bug 20970 was all about fixing the -name diagnostics, since the ONLY file that can ever match -name while containing a / is "/" (and "//" on certain systems).

Eric Blake <ericb>
Group administrator
Wed 30 Jul 2008 11:02:15 AM UTC, original submission:  

This matches no files:

find ./core* -maxdepth 0   -name 'core.\*' -print

But this generates a warning message:

find ./core* -maxdepth 0  -name './core.\*' -print

If it's the only possible way to do something, it probably shouldn't generate a warning message.

James Youngman <jay>
Group administrator

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by ericb (Posted a comment)
  • -email is unavailable- added by jay (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2008-08-31 jay CategoryNone find
        Item GroupNone Wrong result
        StatusNone Works For Me
        Assigned toNone jay
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code