shell-script-pt
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [OT] mega-sena com shell


From: itamarnet
Subject: Re: [OT] mega-sena com shell
Date: 31 Dec 2014 05:04:38 -0800



Algumas sugestões:
1 - apagar o arquivo zip caso existe, se não vai acumular com extensões "zip" "zip.1" zip.2", etc.
2 - unzip -u para sobrescrever aquivos já existentes, sem perguntar.
3 - "grep 'ER' arquivo" ao invés de cat arquivo | grep 'ER'
4 - um sed em substituição ao "sed | grep | sed" ao final

Então que tal assim:

#!/bin/bash
rm -fr D_megase.zip 2>/dev/null
wget http://www1.caixa.gov.br/loterias/_arquivos/loterias/D_megase.zip
unzip -u D_megase.zip
grep -E -a -A 6 '[0-9]{2}/[0-9]{2}/[0-9]{4}' D_MEGA.HTM | 
sed -n '/>[0-9][0-9]</{s/<[^>]*>//g;p;}' | sort | uniq -c | sort


[]'s
Itamar

reply via email to

[Prev in Thread] Current Thread [Next in Thread]