@@ -84,14 +84,17 @@ then
fi
# check the 'pct' field from freesp command is good
-perl -ne '
- BEGIN { $percent = 0; }
- /free/ && next; # skip over free extent size number
- if (/\s+(\d+\.\d+)$/) {
- $percent += $1;
- }
- END { $percent += 0.5; print int($percent), "\n" } # round up
-' <$tmp.xfs_db >$tmp.ans
+awk '
+{
+ if ($0 ~ /free/) {
+ next;
+ }
+
+ percent += $5;
+}
+END {
+ printf("%d\n", int(percent + 0.5));
+}' < $tmp.xfs_db > $tmp.ans
ans="`cat $tmp.ans`"
echo "Checking percent column yields 100: $ans"
if [ "$ans" != 100 ]