Feeds:
Posts
Comentários

Arquivo da categoria ‘Shell’

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 [...]

Ler o post por completo »

#!/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

Ler o post por completo »