TEXT   229
file statuslog new
Guest on 7th December 2024 12:56:45 AM


  1. #!/sprite/cmds/perl
  2.  
  3. $file = "statuslog.new";
  4.  
  5. open(FD, $file) || die("Open of $file failed: $!\n");
  6. while(<FD>) {
  7.     ($type, $serial, $tape, $amount, $errors) = split(' ');
  8.     $name = "$type $serial";
  9.     $drives{$name} += $amount;
  10. }
  11. close(FD);
  12. while(($name, $amount) = each(%drives)) {
  13.     $amount /= 1024;
  14.     printf("%-20s %6.2f GB\n", $name, $amount);
  15. }

Raw Paste

Login or Register to edit or fork this paste. It's free.