Hi! > +sub() > +{ > + minuend=$(echo $1 | sed -r 's/([[:digit:]]{1,}).*/\1/') > + if echo $1 | grep -q -E "m|M"; then > + minuend=$((minuend*1024*1024)) > + flag=m > + elif echo $1 | grep -q -E "k|K"; then > + minuend=$((minuend*1024)) > + flag=k > + else > + flag=0 > + fi > + > + subtrahend=$(echo $2 | sed -r 's/([[:digit:]]{1,}).*/\1/') > + if echo $2 | grep -q -E "m|M"; then > + subtrahend=$((subtrahend*1024*1024)) > + elif echo $2 | grep -q -E "k|K"; then > + subtrahend=$((subtrahend*1024)) > + fi > + > + rest=$((minuend - subtrahend)) > + if [ $flag == m ]; then > + echo $((rest/1024/1024)) > + elif [ $flag == k ]; then > + echo $((rest/1024)) > + else > + echo $rest > + fi
I don't get why we multiply the numbers, substract them and then divide them again. Can't we just substract them? Also does this work for other filesystems than ext2? It may be a good idea to run the test for a few more filesystems as well. We may add a parameter which fs to use and add entries as: df01 -f ext2 df01 -f ext3 ... to the runtest file. Otherwise it looks good. -- Cyril Hrubis chru...@suse.cz ------------------------------------------------------------------------------ _______________________________________________ Ltp-list mailing list Ltp-list@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ltp-list