I have a shell script which was written for Mac OSX and now ported to a linux machine. I don't have access to a linux machine currently( I will be setting up a virtual machine soon) Some statements in the shell script are failing, which is expected. I have a find command statement used for finding files sizes greater than 1MB:
oversize=`find "$somePath" -maxdepth 1 -size +1048576c -iname "*.gz" -print0 | xargs -0 ls -l | wc -l`
oversize=$((oversize * 1))
if [ $oversize -eq 0 ];then
echo "OK"
else
echo "Limit exceeded"
fi
Any idea if something is wrong with this statement ? It flagged a file whose size was 1045400 bytes