From owner-freebsd-questions@FreeBSD.ORG Sun Dec 26 18:01:50 2010 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EE648106566B for ; Sun, 26 Dec 2010 18:01:50 +0000 (UTC) (envelope-from rwmaillists@googlemail.com) Received: from mail-ww0-f50.google.com (mail-ww0-f50.google.com [74.125.82.50]) by mx1.freebsd.org (Postfix) with ESMTP id 8054B8FC13 for ; Sun, 26 Dec 2010 18:01:49 +0000 (UTC) Received: by wwf26 with SMTP id 26so7809778wwf.31 for ; Sun, 26 Dec 2010 10:01:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:subject :message-id:in-reply-to:references:x-mailer:mime-version :content-type:content-transfer-encoding; bh=KMfSr6q1WNOFx4SyUKrg2hJZ4XdScThVu6ItT4THPgE=; b=PaRktWxJY4fQ1OazE1tHMmpdDKYlhH9FDihVNDSiVpcgS+s40JZHZIjV2WDSNQx+Fy L5xoYk81Uc04JLhG4PpPOsBQ+2pBwu3l6Vn2JPYnpH0o2zy+aIkjngsIY+X3oR2mS7M8 VjYXwzYcC6vdZNx0bNnOcVdhhA386af7BqH+g= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=date:from:to:subject:message-id:in-reply-to:references:x-mailer :mime-version:content-type:content-transfer-encoding; b=rQOGul1xvT8foUawB/DLX1+FjgrCcjI/LNlQ26Gav5b5+oP6Hd+GW40FlUwC69cR60 2ziFFW55TNYfXn1it397oNDHJ+dBIeIk5seXKatox+iKWzyUvxFAb+7UfU8aI+XjU7X4 JfyxOYR/Dx92abYc3y3sexAqQNf89XjIzVPSU= Received: by 10.216.78.212 with SMTP id g62mr14871432wee.78.1293386509276; Sun, 26 Dec 2010 10:01:49 -0800 (PST) Received: from gumby.homeunix.com (87-194-105-247.bethere.co.uk [87.194.105.247]) by mx.google.com with ESMTPS id o19sm5471927wee.26.2010.12.26.10.01.47 (version=SSLv3 cipher=RC4-MD5); Sun, 26 Dec 2010 10:01:48 -0800 (PST) Date: Sun, 26 Dec 2010 18:01:45 +0000 From: RW To: freebsd-questions@freebsd.org 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> X-Mailer: Claws Mail 3.7.8 (GTK+ 2.22.1; i386-portbld-freebsd8.1) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: randomising tracks: scripting question X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Dec 2010 18:01:51 -0000 On Sun, 26 Dec 2010 09:40:43 -0800 Chip Camden 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 -")