From owner-freebsd-audit Sun Feb 9 10:42:54 2003 Delivered-To: freebsd-audit@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DCB4637B401; Sun, 9 Feb 2003 10:42:53 -0800 (PST) Received: from storm.FreeBSD.org.uk (storm.FreeBSD.org.uk [194.242.157.42]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0577443FAF; Sun, 9 Feb 2003 10:42:53 -0800 (PST) (envelope-from mark@grondar.org) Received: from storm.FreeBSD.org.uk (Ugrondar@localhost [127.0.0.1]) by storm.FreeBSD.org.uk (8.12.6/8.12.6) with ESMTP id h19Igpja065136; Sun, 9 Feb 2003 18:42:51 GMT (envelope-from mark@grondar.org) Received: (from Ugrondar@localhost) by storm.FreeBSD.org.uk (8.12.6/8.12.6/Submit) with UUCP id h19Igp5B065135; Sun, 9 Feb 2003 18:42:51 GMT X-Authentication-Warning: storm.FreeBSD.org.uk: Ugrondar set sender to mark@grondar.org using -f Received: from grondar.org (localhost [127.0.0.1]) by grimreaper.grondar.org (8.12.6/8.12.6) with ESMTP id h19IctaX035218; Sun, 9 Feb 2003 20:38:55 +0200 (SAST) (envelope-from mark@grondar.org) From: Mark Murray Message-Id: <200302091838.h19IctaX035218@grimreaper.grondar.org> To: Erik Trulsson Cc: Sean Chittenden , audit@FreeBSD.ORG Subject: Re: Making random(6) actually useful... In-Reply-To: Your message of "Sun, 09 Feb 2003 13:46:54 +0100." <20030209124654.GA35137@falcon.midgard.homeip.net> Date: Sun, 09 Feb 2003 18:38:55 +0000 Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Erik Trulsson writes: > > find ~/mp3s -name '*.mp3' | random -f - > play_list.m3u > > Have you looked at misc/shuffle from the ports collection? It seems to > do what you want, is small and is BSD-licensed. We don't need a new tool if an existing tool will work. :-) The above can be done with a (nasty looking) one-liner using jot, wc, paste, sort and awk: $ ${do_stuff} > file && jot -r `wc -l file` 1 | paste /dev/stdin file | sort | awk '{print $2}' > file. && mv file. file Modifying random(6) to do this makes sense, in that it is generalising a tool. Using a whole new tool makes less sense. M -- Mark Murray iumop ap!sdn w,I idlaH To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message