Identifica contatos do google que necessitam de ajustes para o nono digito telefonico
Publicado por Pedro Robson Leão (última atualização em 01/08/2012)
[ Hits: 3.742 ]
O scrip em questão depende do pacote googlecl devidamente configurado (http://code.google.com/p/googlecl/)
O script lê a saída dos contatos do google e informa quais contatos devem ter o numero atualizado com o nono digito.
Modo de uso:
google contacts list --title '.*' --fields name,email,phone | ./sp_check_phone.sh
#!/bin/bash function adapt() { local phone=${1}; echo $((11900000000 + ( phone - 1100000000 ))) } function adapt_udf() { local phone=${1}; [ ${phone} -lt 1169999999 ] && [ ${phone} -ge 1160000000 ] && phone=$( adapt ${phone} ); [ ${phone} -lt 1189999999 ] && [ ${phone} -ge 1180000000 ] && phone=$( adapt ${phone} ); [ ${phone} -lt 1199999999 ] && [ ${phone} -ge 1190000000 ] && phone=$( adapt ${phone} ); [ ${phone} -lt 1150108999 ] && [ ${phone} -ge 1150000000 ] && phone=$( adapt ${phone} ); [ ${phone} -lt 1150209999 ] && [ ${phone} -ge 1150200000 ] && phone=$( adapt ${phone} ); [ ${phone} -lt 1150289999 ] && [ ${phone} -ge 1150230000 ] && phone=$( adapt ${phone} ); [ ${phone} -lt 1150309999 ] && [ ${phone} -ge 1150300000 ] && phone=$( adapt ${phone} ); [ ${phone} -lt 1150409999 ] && [ ${phone} -ge 1150370000 ] && phone=$( adapt ${phone} ); [ ${phone} -lt 1150439999 ] && [ ${phone} -ge 1150430000 ] && phone=$( adapt ${phone} ); [ ${phone} -lt 1150489999 ] && [ ${phone} -ge 1150470000 ] && phone=$( adapt ${phone} ); [ ${phone} -lt 1150509999 ] && [ ${phone} -ge 1150500000 ] && phone=$( adapt ${phone} ); [ ${phone} -lt 1150579999 ] && [ ${phone} -ge 1150570000 ] && phone=$( adapt ${phone} ); [ ${phone} -lt 1150599999 ] && [ ${phone} -ge 1150590000 ] && phone=$( adapt ${phone} ); [ ${phone} -lt 1150609999 ] && [ ${phone} -ge 1150606000 ] && phone=$( adapt ${phone} ); [ ${phone} -lt 1150649999 ] && [ ${phone} -ge 1150640000 ] && phone=$( adapt ${phone} ); [ ${phone} -lt 1150769999 ] && [ ${phone} -ge 1150750000 ] && phone=$( adapt ${phone} ); [ ${phone} -lt 1151019999 ] && [ ${phone} -ge 1151000000 ] && phone=$( adapt ${phone} ); [ ${phone} -lt 1151049999 ] && [ ${phone} -ge 1151040000 ] && phone=$( adapt ${phone} ); [ ${phone} -lt 1151099999 ] && [ ${phone} -ge 1151060000 ] && phone=$( adapt ${phone} ); [ ${phone} -lt 1151109999 ] && [ ${phone} -ge 1151101000 ] && phone=$( adapt ${phone} ); [ ${phone} -lt 1151149999 ] && [ ${phone} -ge 1151130000 ] && phone=$( adapt ${phone} ); [ ${phone} -lt 1151709999 ] && [ ${phone} -ge 1151160000 ] && phone=$( adapt ${phone} ); [ ${phone} -lt 1151799999 ] && [ ${phone} -ge 1151720000 ] && phone=$( adapt ${phone} ); [ ${phone} -lt 1151909999 ] && [ ${phone} -ge 1151900000 ] && phone=$( adapt ${phone} ); [ ${phone} -lt 1152119999 ] && [ ${phone} -ge 1151920000 ] && phone=$( adapt ${phone} ); [ ${phone} -lt 1155009999 ] && [ ${phone} -ge 1152140000 ] && phone=$( adapt ${phone} ); [ ${phone} -lt 1155209999 ] && [ ${phone} -ge 1155200000 ] && phone=$( adapt ${phone} ); [ ${phone} -lt 1155309999 ] && [ ${phone} -ge 1155300000 ] && phone=$( adapt ${phone} ); [ ${phone} -lt 1155409999 ] && [ ${phone} -ge 1155400000 ] && phone=$( adapt ${phone} ); [ ${phone} -lt 1155529999 ] && [ ${phone} -ge 1155500000 ] && phone=$( adapt ${phone} ); [ ${phone} -lt 1155599999 ] && [ ${phone} -ge 1155540000 ] && phone=$( adapt ${phone} ); [ ${phone} -lt 1155709999 ] && [ ${phone} -ge 1155690000 ] && phone=$( adapt ${phone} ); [ ${phone} -lt 1155789999 ] && [ ${phone} -ge 1155770000 ] && phone=$( adapt ${phone} ); [ ${phone} -lt 1155809999 ] && [ ${phone} -ge 1155800000 ] && phone=$( adapt ${phone} ); [ ${phone} -lt 1155909999 ] && [ ${phone} -ge 1155900000 ] && phone=$( adapt ${phone} ); [ ${phone} -lt 1156009999 ] && [ ${phone} -ge 1156000000 ] && phone=$( adapt ${phone} ); [ ${phone} -lt 1156029999 ] && [ ${phone} -ge 1156020000 ] && phone=$( adapt ${phone} ); [ ${phone} -lt 1156109999 ] && [ ${phone} -ge 1156040000 ] && phone=$( adapt ${phone} ); [ ${phone} -lt 1156199999 ] && [ ${phone} -ge 1156170000 ] && phone=$( adapt ${phone} ); [ ${phone} -lt 1156209999 ] && [ ${phone} -ge 1156202000 ] && phone=$( adapt ${phone} ); [ ${phone} -lt 1156309999 ] && [ ${phone} -ge 1156280000 ] && phone=$( adapt ${phone} ); [ ${phone} -lt 1156409999 ] && [ ${phone} -ge 1156360000 ] && phone=$( adapt ${phone} ); [ ${phone} -lt 1156599999 ] && [ ${phone} -ge 1156470000 ] && phone=$( adapt ${phone} ); [ ${phone} -lt 1156649999 ] && [ ${phone} -ge 1156640000 ] && phone=$( adapt ${phone} ); [ ${phone} -lt 1156809999 ] && [ ${phone} -ge 1156800000 ] && phone=$( adapt ${phone} ); [ ${phone} -lt 1156849999 ] && [ ${phone} -ge 1156840000 ] && phone=$( adapt ${phone} ); [ ${phone} -lt 1156909999 ] && [ ${phone} -ge 1156880000 ] && phone=$( adapt ${phone} ); [ ${phone} -lt 1156929999 ] && [ ${phone} -ge 1156920000 ] && phone=$( adapt ${phone} ); [ ${phone} -lt 1156979999 ] && [ ${phone} -ge 1156970000 ] && phone=$( adapt ${phone} ); [ ${phone} -lt 1158109999 ] && [ ${phone} -ge 1157000000 ] && phone=$( adapt ${phone} ); [ ${phone} -lt 1158139999 ] && [ ${phone} -ge 1158130000 ] && phone=$( adapt ${phone} ); [ ${phone} -lt 1158159999 ] && [ ${phone} -ge 1158150000 ] && phone=$( adapt ${phone} ); [ ${phone} -lt 1158209999 ] && [ ${phone} -ge 1158200000 ] && phone=$( adapt ${phone} ); [ ${phone} -lt 1158309999 ] && [ ${phone} -ge 1158280000 ] && phone=$( adapt ${phone} ); [ ${phone} -lt 1158369999 ] && [ ${phone} -ge 1158360000 ] && phone=$( adapt ${phone} ); [ ${phone} -lt 1158389999 ] && [ ${phone} -ge 1158380000 ] && phone=$( adapt ${phone} ); [ ${phone} -lt 1158409999 ] && [ ${phone} -ge 1158400000 ] && phone=$( adapt ${phone} ); [ ${phone} -lt 1158509999 ] && [ ${phone} -ge 1158470000 ] && phone=$( adapt ${phone} ); [ ${phone} -lt 1158699999 ] && [ ${phone} -ge 1158560000 ] && phone=$( adapt ${phone} ); [ ${phone} -lt 1158758999 ] && [ ${phone} -ge 1158753000 ] && phone=$( adapt ${phone} ); [ ${phone} -lt 1158899999 ] && [ ${phone} -ge 1158760000 ] && phone=$( adapt ${phone} ); [ ${phone} -lt 1159039999 ] && [ ${phone} -ge 1159000000 ] && phone=$( adapt ${phone} ); [ ${phone} -lt 1159059999 ] && [ ${phone} -ge 1159050000 ] && phone=$( adapt ${phone} ); [ ${phone} -lt 1159199999 ] && [ ${phone} -ge 1159100000 ] && phone=$( adapt ${phone} ); [ ${phone} -lt 1159207999 ] && [ ${phone} -ge 1159205000 ] && phone=$( adapt ${phone} ); [ ${phone} -lt 1159209999 ] && [ ${phone} -ge 1159209000 ] && phone=$( adapt ${phone} ); [ ${phone} -lt 1159309999 ] && [ ${phone} -ge 1159300000 ] && phone=$( adapt ${phone} ); [ ${phone} -lt 1159379999 ] && [ ${phone} -ge 1159350000 ] && phone=$( adapt ${phone} ); [ ${phone} -lt 1159699999 ] && [ ${phone} -ge 1159400000 ] && phone=$( adapt ${phone} ); [ ${phone} -lt 1159709999 ] && [ ${phone} -ge 1159706000 ] && phone=$( adapt ${phone} ); [ ${phone} -lt 1159999999 ] && [ ${phone} -ge 1159800000 ] && phone=$( adapt ${phone} ); [ ${phone} -lt 1176999999 ] && [ ${phone} -ge 1170110000 ] && phone=$( adapt ${phone} ); [ ${phone} -lt 1179099999 ] && [ ${phone} -ge 1179090000 ] && phone=$( adapt ${phone} ); [ ${phone} -lt 1179229999 ] && [ ${phone} -ge 1179220000 ] && phone=$( adapt ${phone} ); [ ${phone} -lt 1179999999 ] && [ ${phone} -ge 1179500000 ] && phone=$( adapt ${phone} ); echo ${phone}; } function parseline() { local line=${@}; local print=0; LINE=( ${line//[,;]/ /} ); local sz=${#LINE[@]}; local i; for ((i=0;i<sz;i++)) { local token=${LINE[$i]}; token=${token//[+)(- ]/}; echo ${token} | egrep -q '^011[0-9]{8}$]|^+5511[0-9]{8}$|^11[0-9]{8}$' && { [ ${token:0:2} -eq 55 ] && token=${token:2}; [ ${token:0:1} -eq 0 ] && token=${token:1}; local phone=$( adapt_udf ${token} ); [ ${phone} -ne ${token} ] && { [ ${print} == 0 ] && { echo "${LINE[@]}"; print=1; } printf "%10.10s = %11.11s\n" ${token} ${phone}; } } } } function readline() { local line=; while read line; do parseline "${line}"; done } function main() { readline; } main ${@};
Backup, restore e leitura de log com Dialog
Cadastro Regras de Controle de Banda - CBQ
Compartilhando a tela do Computador no Celular via Deskreen
Como Configurar um Túnel SSH Reverso para Acessar Sua Máquina Local a Partir de uma Máquina Remota
Configuração para desligamento automatizado de Computadores em um Ambiente Comercial
Efeito "livro" em arquivos PDF
Como resolver o erro no CUPS: Unable to get list of printer drivers
Flatpak: remover runtimes não usados e pacotes
Mudar o gerenciador de login (GDM para SDDM e vice-versa) - parte 2
Estou com sede em aprender sobre o nosso querido Linux. (1)
big linux sem audio como resolver (2)
Como faz para dar um update-grub por shell script [RESOLVIDO] (3)
[Python] Automação de scan de vulnerabilidades
[Python] Script para analise de superficie de ataque
[Shell Script] Novo script para redimensionar, rotacionar, converter e espelhar arquivos de imagem
[Shell Script] Iniciador de DOOM (DSDA-DOOM, Doom Retro ou Woof!)
[Shell Script] Script para adicionar bordas às imagens de uma pasta