On Wed, Apr 17, 2024 at 11:22 AM Salvo Tomaselli <tipos...@tiscali.it>
wrote:

> Well you can replace with this one
>
> fortune $(dpkg --listfiles fortunes-it | grep
> /usr/share/games/fortunes/  | egrep -v .dat\|.u8 | shuf -n1)


Not quite the same. With the `shuf` you end up getting a fortune from a
random file in the package. My way should choose any random fortune from
all the files.

The latter is a uniform sampling of the fortunes. The former oversamples
fortunes from small files and undersamples from large files.

Your way should be faster, but I don't find performance to be an issue.

Each is fine, but I prefer the completely uniform approach.

Thanks for looking at my issue.

-- 
Anthony Foglia

Reply via email to