Re: [OT] Comando para embaralhar
DF Debian escreveu:
> Olá lista, faz algum tempo q estou tentando achar um comando em shell q
> embaralhe um playlist.
>
> Já testi o sort, ele embaralha mas deixa as musicas do mesmo cantor em
> ordem.
>
> tipo:
>
> mus/Armandinho/Armandinho - Paulinha.ogg
> mus/Armandinho/Armandinho - Ursinho de dormir.ogg
> mus/Baltimora/Baltimora - Tarzan boy.ogg
> mus/Kansas/Kansas - Dust in the wind.ogg
> mus/Bee Gees/Bee Gees - For whom the bell tolls -1994.ogg
> mus/Bee Gees/Bee Gees - You should be dancing.ogg
> mus/Bill Medley/Bill Medley - He ain't heavy, he's my bother - 1988.ogg
> mus/Billy Idol/Billy Idol - Sweet sixteen.ogg
> mus/Billy Idol/Billy Idol - Eyes withow a face - 1984.ogg
> mus/Air Supply/Air Supply - Lost in love.ogg
> mus/Air Supply/Air Supply - Even the nigths are better.ogg
> mus/Boney M/Boney M - Rivers on Babilon.ogg
> mus/Boney M/Boney M - Ma baker.ogg
>
> Alguém tem alguma sugestão?
>
No bash, a variável $RANDOM retorna um número aleatório entre 0 e 32767.
No entanto acho muito mais fácil ordenar por tamanho, por exemplo (ls
-lS) ou por data de criação (ls -ltr). Você poderia dar um touch toda
vez que a música é tocada, aí ela iria para o final da lista, ou usar o
ls por access time (ls -u).
--
Thadeu Penna
Prof.Adjunto IV - Instituto de Física
Universidade Federal Fluminense
Linux User #50500 (counter.li.org)
Debian GNU/Linux alpha-amd64-i386
Reply to: