bugfindutils - Bugs: bug #58541, [wishlist] Add optional sort to...

 
 

bug #58541: [wishlist] Add optional sort to find

Submitter:  Lady Aleena <lady_aleena>
Submitted:  Thu 11 Jun 2020 05:49:51 AM UTC
   
 
Category:  find Severity:  3 - Normal
Item Group:  None Status:  Wont Fix
Privacy:  Public Assigned to:  berny
Originator Name:  Open/Closed:  Closed
Release:  4.6.0 Fixed Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Thu 11 Jun 2020 06:04:30 PM UTC, comment #5: 

Thanks for the report and the open discussion.
As Andreas said, adding such specific features (which are available
otherwise) to tool would finally lead to huge tools which all have
the same set of those specific features.
This would impossible to maintain.  Therefore, the bar is quite high
to add such kind of features.  And sorting is ... well the purpose
of sort(1).
Thus, I'm hereby closing this issue.

Bernhard Voelker <berny>
Group administrator
Thu 11 Jun 2020 05:49:02 PM UTC, comment #4: 

comment #3:

> Well it is the Unix way to have small utilities doing one thing well. There are good reasons for that. You will to need type | some time but you don't need to remember what the sort-output option is called for a dozen utilities and what options this utility-specific sort accepts. Also every added options makes the documentation harder to read and the program harder to maintain. (Increased code size, need for a bigger test-suite, etc.)


I can understand that. This is something I thought would be nice, and I would like to have. If this is closed as a "won't fix" or similar, I will understand that as well.

Lady Aleena <lady_aleena>
Thu 11 Jun 2020 04:04:17 PM UTC, comment #3: 

Lady Aleena:

> Andreas Metzler:
> > Just use
> > find -type f -print0 | sort -fnr --zero-terminated | xargs -r0 whatevercommand
>
> I did that, but it would be nice not to have to pipe so much.


Well it is the Unix way to have small utilities doing one thing well. There are good reasons for that. You will to need type | some time but you don't need to remember what the sort-output option is called for a dozen utilities and what options this utility-specific sort accepts. Also every added options makes the documentation harder to read and the program harder to maintain. (Increased code size, need for a bigger test-suite, etc.)

Andreas Metzler <ametzler>
Thu 11 Jun 2020 01:56:12 PM UTC, comment #2: 

comment #1:

> Just use
> find -type f -print0 | sort -fnr --zero-terminated | xargs -r0 whatevercommand


I did that, but it would be nice not to have to pipe so much.

Lady Aleena <lady_aleena>
Thu 11 Jun 2020 08:13:07 AM UTC, comment #1: 

Just use
find -type f -print0 | sort -fnr --zero-terminated | xargs -r0 whatevercommand

Andreas Metzler <ametzler>
Thu 11 Jun 2020 05:49:51 AM UTC, original submission:  

Yesterday I used find so that I could open the resultant file list in my text editor, but I wanted the files to be opened in sorted order. That meant that I could not use the -exec option since I was piping to sort. It would be nice if I could use something like -sort <maybe some sort options> in find, so that I do not have to pipe find results to sort.

Example of possible usage:

find . -type f -sort
find . -type f -sort fnr

The first is just a plain sort, the second is a case ignored numeric reversed sort. (I used options from sort.)

full find version: find 4.6.0.225-235f
OS: Debian 10

Lady Aleena <lady_aleena>

 

(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 berny (Posted a comment)
  • -email is unavailable- added by lady_aleena (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 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2020-06-11 berny StatusNone Wont Fix
        Assigned toNone berny
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.12.
    Corresponding source code