From owner-freebsd-questions@FreeBSD.ORG Sun Dec 26 17:09:34 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 85923106564A for ; Sun, 26 Dec 2010 17:09:34 +0000 (UTC) (envelope-from frank@esperance-linux.co.uk) Received: from asmtp5.iomartmail.com (asmtp5.iomartmail.com [62.128.201.176]) by mx1.freebsd.org (Postfix) with ESMTP id 1A9B88FC08 for ; Sun, 26 Dec 2010 17:09:33 +0000 (UTC) Received: from asmtp5.iomartmail.com (localhost.localdomain [127.0.0.1]) by asmtp5.iomartmail.com (8.13.8/8.13.8) with ESMTP id oBQH9Vjb031570 for ; Sun, 26 Dec 2010 17:09:31 GMT Received: from orange.esperance-linux.co.uk (80-45-152-196.static.dsl.as9105.com [80.45.152.196]) (authenticated bits=0) by asmtp5.iomartmail.com (8.13.8/8.13.8) with ESMTP id oBQH9VeD031566 for ; Sun, 26 Dec 2010 17:09:31 GMT Received: by orange.esperance-linux.co.uk (Postfix, from userid 1001) id EE25B33C1F; Sun, 26 Dec 2010 17:09:30 +0000 (GMT) Date: Sun, 26 Dec 2010 17:09:30 +0000 From: Frank Shute To: FreeBSD Questions Message-ID: <20101226170930.GA68817@orange.esperance-linux.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.2.3i X-Face: *}~{PHnDTzvXPe'wl_-f%!@+r5; VLhb':*DsX%wEOPg\fDrXWQJf|2\,92"DdS%63t*BHDyQ|OWo@Gfjcd72eaN!4%NE{0]p)ihQ1MyFNtWL X-Operating-System: FreeBSD 8.2-PRERELEASE amd64 X-Organisation: 'shute.org.uk' Subject: randomising tracks: scripting question X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Frank Shute List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Dec 2010 17:09:34 -0000 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