echo usage=”Uso: findJavaClass directory ClassName ”
if [ $# -lt 2 ] ; then
echo $usage
exit 1
fi
if [ -d $1 ] ; then
FIND_CMD=”find $1″
else
echo “Diretorio nao existe”
exit 1
fi
$FIND_CMD -name \*.jar | while read jar_file ;
do
found_class=`unzip -l $jar_file | awk ‘{print $4}’ | grep $2`
num_classes=`echo $found_class | wc [...]
Arquivo da categoria ‘Shell’
Localizar uma classe dentro de um arquivo .jar
Publicado em Java, Shell em Agosto 14, 2007 | Deixar um comentário »
Script para troca de dia e mês (date e sed)
Publicado em Linux, Shell em Agosto 2, 2007 | Deixar um comentário »
#!/bin/sh
#
# Altera o parametro do dia e mes no arquivo
#
# autor: marcio@mangar.com.br
#
diaontem=`date –date=”yesterday” +%d`
diahoje=`date +%d`
mesontem=`date –date=”2 months ago” +%m`
meshoje=`date –date=”1 months ago” +%m`
echo Trocando: $diaontem para: $diahoje
#teste local
/bin/sed -i s/dia=”$diaontem”/dia=$diahoje/g ./teste.html
#producao
#/bin/sed -i s/dia=”$diaontem”/dia=$diahoje/g /home/http/mrtg/teste_wsux1.htm
if [ diahoje == '01' ]
then
echo Trocando: $mesontem para: $meshoje
#teste local
/bin/sed -i s/mes=”$mesontem”/mes=$meshoje/g ./teste.html
#producao
#/bin/sed -i s/mes=”$mesontem”/mes=$meshoje/g /home/http/mrtg/teste_wsux1.htm
fi




