Latest Comments
« Taxi Driver with a PhD | Main | A short note about growing old »

Randomize lines in bash

while read line; do echo "$RANDOM $line"; done < $1 | sort | sed -r "s/^[0-9]+ //" > $2

... sigh... or just
shuf $1 > $2

Reader Comments

There are no comments for this journal entry. To create a new comment, use the form below.

PostPost a New Comment

Enter your information below to add a new comment.

My response is on my own website »
Author Email (optional):
Author URL (optional):
Some HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>