On Tue 14 May 2024, Thomas L. wrote:
>
> On Wed, 8 May 2024 23:14:28 -0500 izder456 <izder...@disroot.org> wrote:
> >
> > I found it as a nice little utility for those who use GNU's shuf, but
> > don't want to use GNU stuff cos of licensing or lack of shuf in
> > userland.
> 
> there is also `sort -R`.

Just note that unlike GNU's shuf(1), `sort -R` (both OpenBSD's and GNU's) will 
group equal keys [1]. This can lead to unexpected behaviour if you say want to 
sample N keys and you expect identical behaviour to shuf(1). Personally, I have 
a short awk(1) script in ~/bin to replicate shuf(1).

[1]: https://man.openbsd.org/sort#R

Reply via email to