web: home-page: Add tcc.html to index.html
[lcapit-junk-code.git] / mega-sena.sh
blob9daeaf3e0062c0bfda9cdde271254727c6592e65
1 #!/bin/bash
3 # Mega-sena loterry
5 # Luiz Fernando N. Capitulino
6 # <lcapitulino@gmail.com>
8 NUMBERS=""
9 MAX_NUMS=6
11 megasena()
13 local max=$1
14 local j=0
15 local nr=0
17 for ((i = 0; i < max; )); do
18 nr=$(($RANDOM % 60))
19 for j in $NUMBER; do
20 if [ $nr -eq $j ]; then
21 break
23 done
25 if [ $nr -ne $j ]; then
26 NUMBERS="$NUMBERS $nr"
27 ((i++))
29 done
32 if [ $# -eq 1 ]; then
33 if [ $1 -ge 6 -a $1 -le 15 ]; then
34 MAX_NUMS=$1
38 megasena $MAX_NUMS
39 echo $NUMBERS