Shouldn't that be bytes? (Cap b, lowercase b being bits, 8 bits in a Byte): Bytes / 1024 (KBytes) / 1024 (KBytes): "echo 5078658 / 1024 / 1024 | bc -l"
Code:
size_t=0; cat /var/log/maillog | grep "from=" | grep "size=" | cut -d "=" -f 3 | cut -d "," -f 1 | while read size_m; do size_t=$(expr $size_t + $size_m)
echo "aprox $(echo $size_t / 1024 / 1024 | bc -l | cut -c 0-3) MB"
echo "aprox $(echo $size_t / 1024 | bc -l | cut -c 0-5) KB"
echo "exactly $size_t Bytes"
echo "exactly $(echo $size_t \* 8 | bc -l ) bits"
done