[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Needing a random number generator for scripting



cat list | \
  perl -e 'srand; rand($.) < 1 && ($line = $_) while <>; print $line;'

-- as suggested on this list earlier, it will return a random line out
of the file list. if you want the entire list to be shuffled, then
search the archives for "random lines" and a post by me. in it's
replies, there is a permutator of input files.

martin;              (greetings from the heart of the sun.)
  \____ echo mailto: !#^."<*>"|tr "<*> mailto:"; net@madduck
-- 
a good scapegoat is nearly as welcome as a solution to the problem.

Attachment: pgpFf9bMN7dGb.pgp
Description: PGP signature


Reply to: