Tradutor: ept ( English to Portuguese )
Publicado por Jean Michel 04/03/2006
[ Hits: 7.417 ]
Script para tradução (Ingles/Portugues) via shell atravez do babylon
=) espero que gostem..
[]'s
dica:
chmod +x ept.sh
mv ept.sh /usr/local/bin
#!/bin/bash
# Simple babylon translator of english to portugues_BR for console
# Tradutor baseado no babylon Ingles/Portugues-BR para console
# $Id: app.sh 314274 2004-05-24 21:04:46Z geiseri $
# ept - Copyright (C) 2005 Jean Michel <jean@toptop>
# Agradadecimentos: Carlindo Marcelo
#Configuração
EPTC="NAO" # Habilita uso do cache de palavras
# funciona porem com alguns bugs
# GENERAL CACHE FILE - Arquivo geral de cache
EPTCFILE="/usr/local/share/.eptcache"
function eptbaccess()
{
# Acesso ao Babylon
lynx -dump -nolist "http://info.babylon.com/cgi-bin/info.cgi?word=$word&lang=5&type=hp&layout=combo.html&n=10&list=" > /tmp/.transl
#
if [ "`grep 'Sorry' /tmp/.transl`" ]; then
echo "PALAVRA NÃO ENCONTRADA!"
else
grep "$word" -A 15 /tmp/.transl | grep -v '____' | grep -v '^$' | grep -v 'all translations'
grep "$word" -A 15 /tmp/.transl | grep -v '____' | grep -v '^$' | grep -v 'all translations' >> $EPTCFILE
echo "-" >> $EPTCFILE
echo ""
fi
function eptcache()
{
for i in `grep "$word" -A 8 $EPTCFILE | grep '' -n | awk '{print $1}'`
do
if [ "$(for b in `echo $i| cut -f 2 -d:`; do d=`echo $i| cut -f 2 -d:`; echo $d | cut -f 2 -d: ; done)" = "-" ]; then
break
fi
fn=`echo $i | cut -f 1 -d:`
done
grep "$word" -A $fn $EPTCFILE | grep -v '-'
echo ""
}
if [ -z $1 ]; then
echo "$0 palavra"
echo -e "ex: $0 kernel\n"
exit
fi
if [ ! -e $EPTCFILE ]; then
touch $EPTCFiLE
fi
word=$1
echo -e "Agarde... Pesquisando pela palavra $word\n"
# Acesso Cache
if [ "$EPTC" = "SIM" ]; then
if [ ! -z "`grep "$word" -A 3 $EPTCFILE`" ]; then
eptcache
else
eptbaccess
fi
else
eptbaccess
fi
rm -f /tmp/.transl
GETPLAMIGA - Baixe a Palavra Amiga do Bispo Macedo
IA Turbina o Desktop Linux enquanto distros renovam forças
Como extrair chaves TOTP 2FA a partir de QRCODE (Google Authenticator)
Linux em 2025: Segurança prática para o usuário
Desktop Linux em alta: novos apps, distros e privacidade marcam o sábado
IA chega ao desktop e impulsiona produtividade no mundo Linux
Atualizando o Fedora 42 para 43
Como saber se o seu e-mail já teve a senha vazada?
Como descobrir se a sua senha já foi vazada na internet?
Mint Xfce não mantém a conexão no wi-fi (2)
Problemas com Driver NVIDIA (5)
Warcraft II Remastered no Linux? (8)









