summaryrefslogtreecommitdiff
path: root/random-words
blob: 440619b2fb373700ad63f79a53c93bce450b681a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/sh

NUM=$1
if [ "$NUM"x = ""x ]; then
    NUM=10
fi

grep -v "'" /usr/share/dict/words | \
    awk '
    	BEGIN {
	    srand()
	}
	{
	    print int(rand() * 1000000), $0
	}' | \
	    sort -n | \
	    awk '{print $2}' | \
	    head -$NUM | xargs echo