bugfindutils - Bugs: bug #55272, wrong use of quotes in the error...

 
 

bug #55272: wrong use of quotes in the error message

Submitted by:  Andreas Metzler <ametzler>
Submitted on:  Sun 23 Dec 2018 03:18:41 PM UTC  
 
Category:  find Severity:  3 - Normal
Item Group:  None Status:  Fixed
Privacy:  Public Assigned to:  Bernhard Voelker <berny>
Originator Name:  Alexander E. Patrakov Open/Closed:  Open
Release:  None Fixed Release:  None

Add a New Comment (Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Tue 08 Jan 2019 07:10:21 PM UTC, comment #5: 
Bernhard Voelker <berny>
Project AdministratorIn charge of this item.
Sat 05 Jan 2019 12:04:21 PM UTC, comment #4: 

Pushed a slightly different version (see attached patch) here:

https://git.sv.gnu.org/cgit/findutils.git/commit/?id=66174c10c6

$ find/find -name 'hello/world'
find/find: warning: '-name' matches against basenames only, \
but the given pattern contains a directory separator ('/'), \
thus the expression will evaluate to false all the time.  \
Did you mean '-wholename'?

Bernhard Voelker <berny>
Project AdministratorIn charge of this item.
Mon 24 Dec 2018 11:08:03 PM UTC, comment #3: 

oops, s/-path/-name/, of course:

- warning: '-path' matches against basenames, ...
+ warning: '-name' matches against basenames, ...

Bernhard Voelker <berny>
Project AdministratorIn charge of this item.
Mon 24 Dec 2018 04:41:47 PM UTC, comment #2: 

> find ... -print0 | grep -FzZ 'phc/*.tex'


That's wrong anyway, because -F means "fixed strings", i.e., no match against a regex pattern.

That whole warning is quite chatty IMO, and should be to the
documentation.  The warning should be more terse like e.g.:

warning: '-path' matches against basenames, did you mean '-wholename'?

... and similar for '-ipath' --> '-iwholename'.

Have a nice (Xmas) day,
Berny

Bernhard Voelker <berny>
Project AdministratorIn charge of this item.
Sun 23 Dec 2018 03:23:02 PM UTC, comment #1: 

grrr. savanah swallowed half of the bug-report. Rich-text without preview suck.

Anyway

find . -name phc/\*.tex

The output is:

find: warning: Unix filenames usually don't contain slashes (though
pathnames do).  That means that '-name `phc/*.tex'' 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
`phc/*.tex''.

However, the backtick has special meaning in bash, and thus should be
replaced with a single quote in the second and the last lines of the
error message. I.e., the error message should suggest to run

find ... -print0 | grep -FzZ 'phc/*.tex'


How about using quoting_style = c_quoting_style?

Andreas Metzler <ametzler>
Sun 23 Dec 2018 03:18:41 PM UTC, original submission:  

Hello,

this was submitted in the Debian BTS as https://bugs.debian.org/487496


find . -name phc/\*.tex

The output is:

Andreas Metzler <ametzler>

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #45874:  0001-find-improve-warning-diagnostic-for-the-name-iname-w.patch added by berny (3KiB - text/x-patch - [PATCH] find: improve warning diagnostic for the -name/-iname with '/' in pattern)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by berny (Posted a comment)
  •  

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

     

     

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-01-05 berny CategoryNone => find
    2019-01-05 berny StatusNone => Fixed
    2019-01-05 berny Attached File- => Added 0001-find-improve-warning-diagnostic-for-the-name-iname-w.patch, #45874
    2018-12-24 berny Assigned toNone => berny
    2018-12-23 ametzler Carbon-CopyRemoved 20807 => -

    Back to the top


    Powered by Savane 3.5