Enviado em 03/05/2016 - 16:55h
Moçada estou tentando fazer esta função para remover arquivos vazios de qualquer tipo de extensão porem ele estadando errodizendo que $arq nao é valido porem em outra função só consegui escluir usando a variavel arq dessa forma mas ja mexi em tudo e nao consegui encontrar uma forma de ele ler e excluir arquivos vazios com a extensão
.* ou *.*
delarqvazio()
{
arq="$1*"
if [ `find * -type f -size 0 | wc -l` -ne 0 ]; then
# Loop files found
for $arq in `find * -type f -size 0`;do
echo "`find * -type f -size 0 | wc -l` empty files(s)"
if [ ! -f "$1" -a ! -d "$1" ]; then
shift
fi
origem="$1";
if [ -e $arq ]; then
shred -n 60 -f -u $arq
echo " Removido Permanentemente..!!!!"
fi
done
fi
}
.* ou *.*
delarqvazio()
{
arq="$1*"
if [ `find * -type f -size 0 | wc -l` -ne 0 ]; then
# Loop files found
for $arq in `find * -type f -size 0`;do
echo "`find * -type f -size 0 | wc -l` empty files(s)"
if [ ! -f "$1" -a ! -d "$1" ]; then
shift
fi
origem="$1";
if [ -e $arq ]; then
shred -n 60 -f -u $arq
echo " Removido Permanentemente..!!!!"
fi
done
fi
}