Skip to content
Snippets Groups Projects

Gerador de certificados da SABER

  • Clone with SSH
  • Clone with HTTPS
  • Embed
  • Share
    The snippet can be accessed without any authentication.
    Authored by Vytor Calixto
    Edited
    certificados.sh 754 B
    mkdir -p certificados
    LINES=$(wc -l credenciamento.txt | cut -d' ' -f1) 
    
    echo $LINES linhas
    
    for i in $(seq 1 $LINES)
    do
        echo Linha $i
        credenciado=$(cat credenciamento.txt | sed "${i}q;d")
        line=$(cat saber.csv | grep -i "${credenciado}")
        name=$(echo $line | cut -d, -f2 | sed "s/'//g")
        email=$(echo $line | cut -d, -f3)
        grr=$(echo $line | cut -d, -f4 | sed 's/GRR//g' | sed 's/grr//g')
        
        echo Gerando certificado para $name
        sed "s/!NOME!/${name}/g" cert.tex > "${name}".tex
        pdflatex "${name}".tex 2> /dev/null > /dev/null
        pdflatex "${name}".tex 2> /dev/null > /dev/null
        pdflatex "${name}".tex 2> /dev/null > /dev/null
    
        rm *.log
        rm *.aux
        rm "${name}".tex
        mv "${name}".pdf certificados/
    done
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Finish editing this message first!
    Please register or to comment