Subject: RE: [hackers-il] Playlist randomization script

From: Chen Shapira <[email-masked]>
Date: Sun, 5 Nov 2000 18:09:43 +0200

But some of us use commandline MP3 playing...

Besides, its a good excersize in awk, if anyone here teaches that kind of
course.

> -----Original Message-----
> From: Shlomi Fish [mailto:[email-masked]]
> Sent: Sunday, November 05, 2000 3:25 PM
> To: [email-masked]
> Subject: Re: [hackers-il] Playlist randomization script
> 
> 
> 
> Interesting, but xmms has a shuffle option, which you can turn on.
> So you can keep the list ordered, and update it only when a 
> new file is
> added or an existing file removed.
> 
> Regards,
> 
> 	Shlomi Fish
> 
> 
> 
> 
> 
> On Sun, 5 Nov 2000, Nadav Har'El wrote:
> 
> > If anyone is interested in my simple playlist randomization 
> script (the
> > one that I've mentioned in previous postings), here it is:
> > 
> > #!/bin/sh
> > # finds all mp3 files in /home/mp3, sorts these in a random 
> order into a
> > # temporary file, and then calls 'xmms' to play the files 
> in this order.
> > 
> > TMPFILE=/tmp/playlist`id -u`.m3u
> > 
> > find /home/mp3 -follow -type f -name "*.mp3" | awk '
> > BEGIN {
> >         srand();
> >         nl=0;
> > }
> > {
> >         line[nl++]=$0
> > }
> > END {
> >         while(nl){
> >                 i=int(rand()*nl)
> >                 print line[i]
> >                 line[i]=line[nl-1]
> >                 nl--
> >         }
> > }
> > ' >$TMPFILE
> > 
> > exec xmms $TMPFILE
> > 
> > 
> > -- 
> > Nadav Har'El                        |       Sunday, Nov 5 
> 2000, 7 Heshvan 5761
> > [email-masked]             
> |-----------------------------------------
> > Phone: +972-53-245868, ICQ 13349191 |This message contains 
> 100% recycled
> > http://nadav.harel.org.il           |characters.
> > 
> > 
> > To unsubscribe from this group, send an email to:
> > [email-masked]
> > 
> > 
> > 
> > 
> 
> 
> 
> ----------------------------------------------------------------------
> Shlomi Fish        [email-masked] 
> Home Page:         http://t2.technion.ac.il/~shlomif/
> Home E-mail:       [email-masked]
> 
> The prefix "God Said" has the extraordinary logical property of 
> converting any statement that follows it into a true one.
> 
> 
> To unsubscribe from this group, send an email to:
> [email-masked]
> 
> 
>

---

From: Chen Shapira <[email-masked]>
Date: Sun, 5 Nov 2000 19:27:08 +0200

> And no, Chen, this wasn't an awk excercise :) I'm way beyond 
> needing more
> awk excercise :)

Unfortunately, I'm not. 
So it *was* a good excersize, just not for you :-)

---

From: Ishay Sommer <[email-masked]>
Date: Sun, 5 Nov 2000 19:33:16 +0200

Is there anyone on the list working at checkpoint?

-----Original Message-----
From: Chen Shapira [mailto:[email-masked]]
Sent: Sunday, November 05, 2000 7:27 PM
To: [email-masked]'
Subject: RE: [hackers-il] Playlist randomization script

Unfortunately, I'm not.