Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 26 Dec 2010 12:08:36 -0800
From:      Devin Teske <dteske@vicor.com>
To:        Frank Shute <frank@shute.org.uk>
Cc:        RW <rwmaillists@googlemail.com>, freebsd-questions@freebsd.org
Subject:   Re: randomising tracks: scripting question
Message-ID:  <61895BE3-5435-4515-A439-F1C2273B93CB@vicor.com>
In-Reply-To: <20101226190217.GA69973@orange.esperance-linux.co.uk>
References:  <20101226170930.GA68817@orange.esperance-linux.co.uk> <20101226174043.GB10951@libertas.local.camdensoftware.com> <20101226180145.7eae6855@gumby.homeunix.com> <20101226190217.GA69973@orange.esperance-linux.co.uk>

next in thread | previous in thread | raw e-mail | index | archive | help

On Dec 26, 2010, at 11:02 AM, Frank Shute wrote:

> On Sun, Dec 26, 2010 at 06:01:45PM +0000, RW wrote:
>>=20
>> On Sun, 26 Dec 2010 09:40:43 -0800
>> Chip Camden <sterling@camdensoftware.com> wrote:
>>=20
>>> Quoth Frank Shute on Sunday, 26 December 2010:
>>>> I generally play my tracks of an album like so:
>>>>=20
>>>> for track in $(cat trombone_shorty-backatown.m3u); do
>>>> mplayer $track
>>>> done
>>>>=20
>>>> They then play in the correct order.
>>>>=20
>>>> How would I go about randomising the order of play using
>>>> sh (preferably) or perl?
>>>>=20
>>>> Sorry for the OT posting but I thought a brainteaser might clear =
the
>>>> fog caused by excessive Xmas indulgence ;)
>>>>=20
>>>>=20
>>>> Regards,
>>>=20
>>> change "cat t...n.m3u" to "random < t..n.m3u"
>>>=20
>>=20
>> That should be=20
>>=20
>> random -f trombone_shorty-backatown.m3u
>>=20
>> see random(6) for what happens when it reads directly from stdin
>> (without "-f -")
>>=20
>=20
> Excellent. I didn't know about random(6), I was getting lost in the
> manpages: there are manpages for random in 3 different sections!
> Should have used apropos.
>=20

Just keep in mind that random(6) comes from the `games' =
distribution-set.

wget -r =
ftp://ftp-archive.freebsd.org/pub/FreeBSD/releases/i386/8.1-RELEASE/games
cd games
sudo ./install.sh

Not sure if it's available anywhere else.
--
Devin





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?61895BE3-5435-4515-A439-F1C2273B93CB>