- or download this
use strict;
use warnings;
- or download this
#Checks the type of OS here
...
if ($OS == SunOS ) {
&< snip1 &<
- 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! &<
- 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");
- 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
- or download this
$DU = `du -sh $FILESYSTEM | sort -rn | head -20`;
- or download this
...
} @summary[0..19]
);