
Untitled
By: a guest on
May 8th, 2012 | syntax:
Bash | size: 0.65 KB | hits: 31 | expires: Never
#!/bin/bash
DRAW=$1
if [ -z $DRAW ];then
echo "Draw number not found"
echo "Usage: $0 <Draw Number>"
exit 1
fi
if [ $DRAW == 950 ]; then
NUMBERS="06|02|37|34|36|25|29|03|08"
GAMEFILE="lotto$DRAW"
elif [ $DRAW == 951 ]; then
NUMBERS="17|08|28|34|41|42|06|04|19"
GAMEFILE="lotto$DRAW"
else
echo "Draw number not found"
exit 1
fi
IFS=$'\n'
for d in $( egrep --color=always "$NUMBERS" $GAMEFILE )
do
echo -n "$d - " ; echo "$d" | col -b |\
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}'
done