bash - want to pipe while read find thru shuf util -


i use input random song selector:

done < <(sort -zur <(find "$dir" -type f \( -name '*.mp3' -o -name '*.ogg' \) -print0)) 

but have noticed songs same album in consider rather large music catalogue. anyways wanted try , pipe thru 'shuf' see if notice difference, can't seem work.

i tried felt obvious:

done < <(shuf <(find "$dir" -type f \( -name '*.mp3' -o -name '*.ogg' \) -print0)) 

and then:

done < <(find "$dir" -type f \( -name '*.mp3' -o -name '*.ogg' \) -print0|shuf) 

and in case:

done < <(find "$dir" -type f \( -name '*.mp3' -o -name '*.ogg' \)|shuf) 

but far no love.

but when create array , walk thru elements 'for' loop pipe 'shuf' seems work fine:

trksshuf=($(find "$dir" -type f \( -name '*.mp3' -o -name '*.ogg' \)|shuf) 

you didn't write how attempts fail you, quick shuf(1) manual suggests using -z switch adapt nul-separated input.


Comments

Popular posts from this blog

c# - How to get the current UAC mode -

postgresql - Lazarus + Postgres: incomplete startup packet -

javascript - Ajax jqXHR.status==0 fix error -