Re: Making random(6) actually useful...
Mark Murray <[email protected]> Sun, 09 Feb 2003 18:38:55 +0000
| Newsgroups | gmane.os.freebsd.devel.audit |
|---|---|
| Message-ID | <[email protected]> |
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 [email protected]
with "unsubscribe freebsd-audit" in the body of the message