# Get: # http://www.wclc.com/download/wclc/LOTTO_649_SINCE_INCEPTION_including_July_08.pdf # Then to generate a text file: pdftotext -layout LOTTO_649_SINCE_INCEPTION_including_July_08.pdf # Then to get the lines we want (they start with the date): grep '\^* [0-9]*, [0-9][0-9][0-9][0-9]' file.txt # Remove multple spaces: sed 's/ */ /g' # Cut the fields we want: cut -d ' ' -f4,5,6,7,8,9,10 # So we end up with: grep '\^* [0-9]*, [0-9][0-9][0-9][0-9]' LOTTO_649_SINCE_INCEPTION_including_July_08.txt \ | sed 's/ */ /g' | cut -d ' ' -f4,5,6,7,8,9,10 # This gives a list of all the 649 number results. The last number in each # line is the bonus. # Make statistics of how often numbers come out: grep '\^* [0-9]*, [0-9][0-9][0-9][0-9]' LOTTO_649_SINCE_INCEPTION_including_July_08.txt \ | sed 's/ */ /g' | cut -d ' ' -f4,5,6,7,8,9,10 | sed 's/ /\n/g' > stats-nums.txt #!/bin/nice /bin/bash rm stats.txt for ((i=1;i<=49;i+=1)); do times=$(grep "^$i$" stats-nums.txt | wc -l) echo "$i came out $times times" >> stats.txt done # This doesn't work properly: echo $(($(echo $(head -100 /dev/urandom | od -N 30) | cut -d ' ' -f2,3,4,5,6,7,8,9 | \ sed 's/ //g') % 49 +1)) | sed -e 's/-//' -e '/^0/d' # Maybe: #!/bin/nice /bin/bash for ((i=1;i<=9999;i+=1)); do N=5 ; for x in $(for i in $(seq 1 $N); do (dd if=/dev/urandom bs=4k count=1 2> /dev/null ; \ date ; ps -ef) | sha1sum -b ; done | cut -d' ' -f1 | cut -c4-11) ; \ do Y=$(printf "%d\n" 0x$x) ; Z=$(expr $Y % 50) ; echo "$Z" >> rng-results.txt ; done done