Randomize-lines
From Noah.org
Revision as of 14:08, 1 July 2008 by Root (talk | contribs) (New page: Category:Engineering The `rl` command will take input and output random lines. On Ubuntu you can install `rl` this way: <pre> sudo apt-get install randomize-lines </pre> This example...)
The `rl` command will take input and output random lines. On Ubuntu you can install `rl` this way:
sudo apt-get install randomize-lines
This example selects a random restaurant from a list:
echo "Metate Taco Double Play Pub MotoJava cafe Utah Saloon" | rl -c 1
This example plays a random video on the filesystems indexed by `locate`:
locate *.avi | rl -c 1 | xargs -n 1 -d \\n mplayer
This example searches for videos in the current working directory and randomly plays a video:
find . -name '*.avi' -print0 | rl -0 | xargs -n 1 -0 mplayer