bugfindutils - Bugs: bug #66965, Multiple -files0-from args...

 
 

bug #66965: Multiple -files0-from args overwrite each other

Submitter:  Tavian Barnes <tavianator>
Submitted:  Sun 30 Mar 2025 02:45:33 PM UTC
   
 
Category:  find Severity:  3 - Normal
Priority:  5 - Normal Item Group:  None
Status:  Working as Intended Privacy:  Public
Assigned to:  berny Originator Name: 
Open/Closed:  Open Release:  4.10.0
Fixed Release:  4.11.0
* Mandatory Fields

Post a Comment

Add a New Comment Rich Markup
   

Discussion

Sun 06 Apr 2025 02:52:31 PM UTC, comment #2: 

Pushed a test to document the behavior:
https://git.sv.gn ... /?id=ee500667d499

Bernhard Voelker <berny>
Group administrator
Mon 31 Mar 2025 07:13:44 PM UTC, comment #1: 

Thanks for the report.
However, it is quite common in the GNU world that an option with
another argument overwrites the one passed first.


ls --sort=time --sort=size


There's also another example for a tool having a --files0-from=FILE option:

$ printf b > b
$ printf a > a
$ du --files0-from=a --files0-from=b
4        b
$ du --files0-from=b --files0-from=a
4        a


In that regard, the behavior might be surprising, yet IMO the
implementation in GNU find(1) is fine.
In contrast, things might get more complicated - at least in the implementation - if find(1) would accept and process more given files e.g. for '-files0-from - -files0-from -' or even '-files0-from - -files0-from /dev/stdin'.  Let's keep it simple.

As such, I'm meanwhile setting this issue to "working as intended".

I only see that the current behavior is not explicitly documented.  I consent we should do that.

Bernhard Voelker <berny>
Group administrator
Sun 30 Mar 2025 02:45:33 PM UTC, original submission:  

If you specify -files0-from twice, only the last one takes effect:


tavianator@tachyon $ printf find/tree.c >a
tavianator@tachyon $ printf find/util.c >b
tavianator@tachyon $ find -files0-from a -files0-from b
find/util.c


This is somewhat surprising, and there's no warning or anything.  I think ideally it would use the starting points from both files.

Tavian Barnes <tavianator>

 

Attached Files

This item currently has no attached files.

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

Attach Files:
   
   
Comment:
   

 

Dependencies

This item does not depend on any other items.

No items depend on this one.

 

Mail Notification Carbon-Copy List

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

    Votes

    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.

     

    History

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2025-04-06 berny Fixed ReleaseNone 4.11.0
    2025-03-31 berny StatusNone Working as Intended
        Assigned toNone berny

    Back to the top

    Powered by Savane 3.16-ed84.
    Corresponding source code