I have this script ;
for dir in `find $STRT -type d -depth -print`
do NUM=`ls -la $dir | grep ^- | wc -l`
SIZ=`ls -la $dir | grep ^- | awk '{sum+=$5} END{print sum}`
echo $dir = $NUM files , $SIZ bytes
TOTN=`expr $TOTN + $NUM`
TOTS=`expr $TOTS + $SIZ`
done
It fails with this error ;
/sag/backups/Recycle = 153 files , 1.56302e+10 bytes
expr: 0402-046 A specified operator requires numeric parameters.
How do I get the awk to return size in integer (NOT scientific notation) ?
for dir in `find $STRT -type d -depth -print`
do NUM=`ls -la $dir | grep ^- | wc -l`
SIZ=`ls -la $dir | grep ^- | awk '{sum+=$5} END{print sum}`
echo $dir = $NUM files , $SIZ bytes
TOTN=`expr $TOTN + $NUM`
TOTS=`expr $TOTS + $SIZ`
done
It fails with this error ;
/sag/backups/Recycle = 153 files , 1.56302e+10 bytes
expr: 0402-046 A specified operator requires numeric parameters.
How do I get the awk to return size in integer (NOT scientific notation) ?