Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

Re^3: Getting error while executing the script

by blue_cowdawg (Monsignor)
on Jun 14, 2012 at 14:11 UTC ( #976219=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download

  1. or download this
    use strict;
    use warnings;
  2. or download this
    #Checks the type of OS here
    if ($OS == SunOS ) {
       &< snip1 &<
  3. or download this
    my $os = `uname -s`;   # why capital?
    chomp $os;             # get rid of the EOL character, you'll be glad 
    +you did.
    if ( $os eq 'SunOS' ) {    # this is where EOL needs to be gone...
    &< snip! &<
  4. or download this
    $DF = `df -h $FILESYSTEM | grep -v "Filesystem" | sed -e "s/%//g"|
    +awk '{print $5}'`;
        print ("The file system $ FILESYSTEM usage is $DF % \n");
  5. or download this
    my $cmd=sprintf("df -k %s |",$FILESYSTEM)  #note the trailing pipe in 
    +the format
    open PIPE,$cmd or die "$cmd: $!";
    chomp $df;      # just for grins
    $df =~ s/\%//g; # strip the %
    printf "File system %s is %d%% used\n",$FILESYSTEM,$df
  6. or download this
    $DU = `du -sh $FILESYSTEM | sort -rn | head -20`;
  7. or download this
            } @summary[0..19]

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://976219]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (2)
As of 2015-10-10 16:53 GMT
Find Nodes?
    Voting Booth?

    Does Humor Belong in Programming?

    Results (257 votes), past polls