Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- #script para localização de resultados dos candidatos aprovados e suas respectivas notas no concurso do CONFEA
- id=296005000
- limite=296000000
- alpha=( L M N O P Q R S T U V )
- while [ $id -ge $limite ]
- do
- flag=0;
- for (( i=0; i<=10; i++ ))
- do
- if [ $flag -eq 0 ]
- then
- insc=$id${alpha[$i]}
- curl -s http://187.61.13.178/Concursos/CONFEA_2011/Resultado_Pos_Recurso_2/resultado.asp?v_insc=${insc} > .tmp
- valido=`cat .tmp | grep RESULTADOS | awk '{ print $2 }' | cut -f2 -d\"`
- if [ "$valido" == "#FF0000" ]
- then
- flag=1
- curso=`cat .tmp | grep 2021PAL | awk '{ print $1 }'`
- if [ "$curso" == "2021PAL" ] #código de vaga para AGRONOMIA
- then
- nota=`cat .tmp | sed -n '/Prova Objetiva/{x;p;};h' | cut -f2 -d\> | cut -f1 -d\<`
- cpf=`cat .tmp | sed -n '/CPF/{n;p;}' | awk '{ print $5 }' | cut -f3 -d\>`
- echo ${nota},${curso},${insc},${cpf}
- #armazenar dados do candidato no arquivo OUTPUT
- echo ${nota},${curso},${insc},${cpf} >> output
- echo ${insc} >> inscricoesvalidas
- else
- echo ${insc}
- #armazenar todas as inscrições válidas encontradas
- echo ${insc} >> inscricoesvalidas
- fi
- else
- echo $insc não encontrado
- fi
- else
- break;
- fi
- done
- let id=$id-1
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement