[gull] ls au hasard

Olivier Bornet Olivier.Bornet at puck.ch
Tue Jan 24 11:26:09 CET 2006


Hello,

> >   find -iname \*.mp3 | perl -MList::Util=shuffle -e 'print shuffle <>'
> >
> Je vais tenter ça. Je ne sais pas si la GeexBox embarque Perl, mais je 
> vais tenter (je l'aurais fait en Python mais visiblement ... ya pas ça)

Un peu plus long, mais c'est aussi possible :

find -iname \*.mp3 | python -c "import random; import sys;
l = sys.stdin.readlines (); random.shuffle (l);
[sys.stdout.write (i) for i in l]"

(Attention à mettre soit sur une ligne, soit sans espaces en début de
ligne).

Bonne journée.

        Olivier
-- 
Olivier Bornet
Olivier.Bornet at puck.ch
Swiss Ice Hockey Results : http://puck.ch/
Get my PGP-key at http://puck.ch/pgp or at http://pgp.mit.edu/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://forum.linux-gull.ch/pipermail/gull/attachments/20060124/544c7f51/attachment.pgp>


More information about the gull mailing list