Skip to content

Conversation

BenWiederhake
Copy link
Collaborator

This PR makes shuf behave more like GNU shuf in the case of empty files (e.g. null stdin).

Old behavior:

$ true | cargo run -- shuf | hd
00000000  0a                                                |.|
00000001
$

GNU behavior:

$ true | shuf | hd
$

New behavior:

$ true | cargo run -- shuf | hd
$

Note that this also makes shuf-reservoir.sh in the GNU shuf tests happy.

I'm mostly new to uutils, so please do point out any resources that might help me. (I've already read {DEVELOPMENT,CONTRIBUTING,CODE_OF_CONDUCT}.md.)

Copy link

GNU testsuite comparison:

Congrats! The gnu test tests/shuf/shuf-reservoir is no longer failing!

@cakebaker cakebaker merged commit bfe6f0f into uutils:main Feb 16, 2024
@cakebaker
Copy link
Contributor

Thanks for your PR and congrats for making shuf-reservoir.sh pass :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants