Help for this page

Select Code to Download


  1. or download this
    #!/opt/local/bin/perl
    #script that pesters users who use up too much space in /home
    ...
            print "$uid: $sp";
        } ## end if ( my ( $sp, $uid ) = $i =~ m{\s?(\d+)\s+/(?:\w+/)*(m\d
    +[a-z]{3}\d{2})} )
    } ## end foreach my $i (@HOM_USE_BY_DIR)
    
  2. or download this
    my $KiB = <>; my @pref = qw(M G T P);my $i = 0; while($i<@pref){last i
    +f $KiB/1024 < 1; $KiB/=1024;$i++} print "$KiB$pref[$i]iB\n"
    
  3. or download this
    perl -ne'chomp(my $KiB =$_); my @pref = qw(K M G T P);my $i = 0; while
    +($i<@pref){ last if $KiB/1024 < 1; $KiB/=1024;$i++} printf "${_}KiB =
    + %.3f$pref[$i]iB\n",$KiB'
    
  4. or download this
    perl -lne
    'my $KiB =$_; 
    ...
    $i++
    } 
    printf "${_}KiB = %.3f$pref[$i]iB\n ",$KiB'