On Thu, 2007-04-19 at 18:28 -0400, A. Costa wrote:
> % man rl | grep -nA 11 simple
> 65: Some simple demonstrations of how rl can help you do everyday
> tasks.
> 66- Warning: some of these examples may affect the operation of
> your
> 67- system.
> {stuff deleted....}
> 75- Kill a random process on your computer.
> 76- kill -9 `ps -A | awk '{print $1}' | rl --count=1`
>
> Lines #75-76 seem potentially harmful. Granted the example is amusing
> in a "are you still reading this?" sort of way, but most man page
> readers want plain utility.I'm not very inclined to change this. I always thought it was a nice example of how to use randomize lines (I like the example). Maybe I will reword it slightly or include a warning with this specific example. > Furthermore the introduction in line #65 claims what follows are > "everyday tasks". Killing a random process is no everyday task, except > for a "script kiddie" or a general system tester perhaps. It also includes a rather fat warning already to be careful. > Suggested benign replacement: > > # play the 15 most recent .mp3 files from amule, in random order. > ls -c ~/amule/downloads/*.mp3 | head -n 15 | rl | sed 's/\(.*\)/"\1"/' | > xargs play > > (The 'sed' code quotes the song titles, as some contain space. > '/usr/bin/play' is from the 'sox' package.) There are already two examples that use rl as a playlist randomizer. I like the idea of playing the last so many number of files though but I don't like using the output of ls because many people alias ls to pass it more options (e.g. -F) for highlighting purposes. -- -- arthur - [EMAIL PROTECTED] - http://people.debian.org/~adejong --
signature.asc
Description: This is a digitally signed message part

