Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 26 Dec 2010 18:01:45 +0000
From:      RW <rwmaillists@googlemail.com>
To:        freebsd-questions@freebsd.org
Subject:   Re: randomising tracks: scripting question
Message-ID:  <20101226180145.7eae6855@gumby.homeunix.com>
In-Reply-To: <20101226174043.GB10951@libertas.local.camdensoftware.com>
References:  <20101226170930.GA68817@orange.esperance-linux.co.uk> <20101226174043.GB10951@libertas.local.camdensoftware.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, 26 Dec 2010 09:40:43 -0800
Chip Camden <sterling@camdensoftware.com> wrote:

> Quoth Frank Shute on Sunday, 26 December 2010:
> > I generally play my tracks of an album like so:
> > 
> > for track in $(cat trombone_shorty-backatown.m3u); do
> > mplayer $track
> > done
> > 
> > They then play in the correct order.
> > 
> > How would I go about randomising the order of play using
> > sh (preferably) or perl?
> > 
> > Sorry for the OT posting but I thought a brainteaser might clear the
> > fog caused by excessive Xmas indulgence ;)
> > 
> > 
> > Regards,
> > 
> > -- 
> > 
> >  Frank
> > 
> >  Contact info: http://www.shute.org.uk/misc/contact.html
> > 
> > 
> > _______________________________________________
> > freebsd-questions@freebsd.org mailing list
> > http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> > To unsubscribe, send any mail to
> > "freebsd-questions-unsubscribe@freebsd.org"
> 
> change "cat t...n.m3u" to "random < t..n.m3u"
> 

That should be 

random -f trombone_shorty-backatown.m3u

see random(6) for what happens when it reads directly from stdin
(without "-f -")




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20101226180145.7eae6855>