From: Chris Koeritz Date: Mon, 15 Jun 2015 15:13:02 +0000 (-0400) Subject: slicker listing leaves off mbytes if there are none. also added gbytes count with... X-Git-Tag: 2.140.90~626 X-Git-Url: https://feistymeow.org/gitweb/?a=commitdiff_plain;h=f3393b43f314113dae4cea5330abb93b5fb1a090;p=feisty_meow.git slicker listing leaves off mbytes if there are none. also added gbytes count with same consideration. --- diff --git a/scripts/files/summing_dir.pl b/scripts/files/summing_dir.pl index 4aa2031c..10604659 100644 --- a/scripts/files/summing_dir.pl +++ b/scripts/files/summing_dir.pl @@ -94,9 +94,19 @@ unlink($temp_file); # clean up. local($total)=int($lengths); local($kbytes)=int($total / 102.4) / 10; local($mbytes)=int($kbytes / 102.4) / 10; +local($gbytes)=int($mbytes / 102.4) / 10; print "\n"; -print "These files occupy $total bytes ($kbytes KB / $mbytes MB).\n"; +# print a fancy listing showing bytes at least, but only showing mb and gb if appropriate. +print "These files occupy $total bytes ($kbytes KB"; +if ($mbytes ne 0) { + print " / $mbytes MB"; +} +if ($gbytes ne 0) { + print " / $gbytes GB"; +} +print ").\n"; + print "Overall Drive Usage (megs):\n"; system("df -m $chewed_line >$temp_file");