Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upShould -X behavior match xargs? #441
Comments
|
Thank you for reporting this. I'm going to summarize from what I said in the linked ticket:
That being said, I don't really know why the order of |
|
I believe this can be explained by the buffering logic, specifically Line 231 in 5cbd840 |
|
Oh, of course. I completely forgot about this. If the search finishes within the buffering time (100 ms, by default), we actually sort the search results before printing them to the console. For |
|
Closed via #524 by @MarcoIeni and @crash-g. |
|
Released in fd 7.5.0 |
As discussed in this
batissue, the behavior offd's-Xflag is different from the behavior offd | xargs. My initial impression upon reading the docs was that-X's behavior would be equivalent to piping toxargs, and I was surprised when that wasn't the case.Shell session for reference:
In short, I would expect
-X's order to be the order returned by a normal call tofd(while I would expect-x's order to be random because the docs make clear that operation is parallelized).