Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 8th, 2012  |  syntax: Bash  |  size: 0.65 KB  |  hits: 31  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. #!/bin/bash
  2.  
  3. DRAW=$1
  4.  
  5. if [ -z $DRAW ];then
  6.     echo "Draw number not found"
  7.     echo "Usage: $0 <Draw Number>"
  8.     exit 1
  9. fi
  10.  
  11. if [ $DRAW == 950 ]; then
  12.     NUMBERS="06|02|37|34|36|25|29|03|08"
  13.     GAMEFILE="lotto$DRAW"
  14. elif [ $DRAW == 951 ]; then
  15.     NUMBERS="17|08|28|34|41|42|06|04|19"
  16.     GAMEFILE="lotto$DRAW"
  17. else
  18.     echo "Draw number not found"
  19.     exit 1
  20. fi
  21.  
  22. IFS=$'\n'
  23.  
  24. for d in $( egrep --color=always "$NUMBERS" $GAMEFILE )
  25. do
  26.     echo -n "$d - " ; echo "$d" | col -b |\
  27.     awk '{m=gsub("01;31","");sum+=m}END{ if (sum >= 4 ) print "\033[1;31m" sum "\033[0m \033[0;33m* * * WINNING LINE * * *\033[0m" ; else print sum}'
  28. done