On 23/10/2026 12:08 am, Greg Wooledge wrote:
Harnessing shuf(1) to shuffle a list of filenames presents its own flavor of challenge.
[...]
cd /wherever || exit
readarray -t -d '' playlist < <( printf '%s\0' * | shuf -z )
for file in "${playlist[@]}"; do
mpv -- "$file"
done
I had in mind something like find /wherever -type f -print0 | shuf -z -n 10 | xargs -0 -n 1 mpv -- perhaps with more filtering options.

