Enviado em 08/04/2009 - 17:10h
Pessoal alguem poderia me ajudar falando qual é função que converte string para integer ou float em shell script?
#!/bin/bash
tamanho_max=7,4M
t=$(/usr/bin/du -h -s /home/backup/)
total=$(echo $t |cut -f1 -d"/")
echo "$t"
echo $total
echo $total+1
if [ ${total} -ge ${tamanho_max} ]
then
echo "maior"
else
echo "menor"
fi
#!/bin/bash
tamanho_max=7,4M
t=$(/usr/bin/du -h -s /home/backup/)
total=$(echo $t |cut -f1 -d"/")
echo "$t"
echo $total
echo $total+1
if [ ${total} -ge ${tamanho_max} ]
then
echo "maior"
else
echo "menor"
fi