root@server1 [/]# cat ss4
#!/usr/bin/perl
$a=`uptime`;
$a =~ /[\d*],/;
#echo "a = $a"
if ( $a < 5.2 ){
print $a;
}
root@server1 [/]# ./ss4
1:04pm up 29 days, 18:41, 1 user, load average: 0.24, 0.33, 0.29
How do I get this to display only the 0.24 and not the full output of uptime?
#!/usr/bin/perl
$a=`uptime`;
$a =~ /[\d*],/;
#echo "a = $a"
if ( $a < 5.2 ){
print $a;
}
root@server1 [/]# ./ss4
1:04pm up 29 days, 18:41, 1 user, load average: 0.24, 0.33, 0.29
How do I get this to display only the 0.24 and not the full output of uptime?