Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 09 Feb 2003 18:38:55 +0000
From:      Mark Murray <mark@grondar.org>
To:        Erik Trulsson <ertr1013@student.uu.se>
Cc:        Sean Chittenden <seanc@FreeBSD.ORG>, audit@FreeBSD.ORG
Subject:   Re: Making random(6) actually useful... 
Message-ID:  <200302091838.h19IctaX035218@grimreaper.grondar.org>
In-Reply-To: Your message of "Sun, 09 Feb 2003 13:46:54 %2B0100." <20030209124654.GA35137@falcon.midgard.homeip.net> 

next in thread | previous in thread | raw e-mail | index | archive | help
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




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