Advertisement
atcasanova

Untitled

Feb 3rd, 2012
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.27 KB | None | 0 0
  1. #!/bin/bash
  2. #script para localização de resultados dos candidatos aprovados e suas respectivas notas no concurso do CONFEA
  3. id=296005000
  4. limite=296000000
  5. alpha=( L M N O P Q R S T U V )
  6.  
  7. while [ $id -ge $limite ]
  8. do
  9.     flag=0;
  10.     for (( i=0; i<=10; i++ ))
  11.     do
  12.         if [ $flag -eq 0 ]
  13.         then
  14.             insc=$id${alpha[$i]}
  15.             curl -s http://187.61.13.178/Concursos/CONFEA_2011/Resultado_Pos_Recurso_2/resultado.asp?v_insc=${insc} > .tmp
  16.             valido=`cat .tmp | grep RESULTADOS | awk '{ print $2 }' | cut -f2 -d\"`
  17.             if [ "$valido" == "#FF0000" ]
  18.             then
  19.                 flag=1
  20.                 curso=`cat .tmp | grep 2021PAL | awk '{ print $1 }'`
  21.                 if [ "$curso" == "2021PAL" ] #código de vaga para AGRONOMIA
  22.                 then
  23.                     nota=`cat .tmp | sed -n '/Prova Objetiva/{x;p;};h' | cut -f2 -d\> | cut -f1 -d\<`
  24.                     cpf=`cat .tmp | sed -n '/CPF/{n;p;}' | awk '{ print $5 }' | cut -f3 -d\>`
  25.                     echo ${nota},${curso},${insc},${cpf}
  26.                     #armazenar dados do candidato no arquivo OUTPUT
  27.                     echo ${nota},${curso},${insc},${cpf} >> output
  28.                     echo ${insc} >> inscricoesvalidas
  29.                 else
  30.                     echo ${insc}
  31.                     #armazenar todas as inscrições válidas encontradas
  32.                     echo ${insc} >> inscricoesvalidas
  33.                 fi
  34.             else
  35.                 echo $insc não encontrado
  36.             fi
  37.         else
  38.             break;
  39.         fi
  40.     done
  41. let id=$id-1
  42. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement