3

Can I execute complicated linux command inside perl? [closed]

view full story
linux-howto

http://serverfault.com – Possible Duplicate: how can execute complicated linux command inside perl Sir, #!/usr/bin/perl @HOSTS = ("192.168.14.112", "192.168.14.90", "192.168.160.1", "192.168.160.100"); my $COUNT = 4; my $date =`date`; for my $myHost (@HOSTS) { **$count = `ping -c $COUNT $myHost | grep 'received' |awk -F',' '{ print $2 }' |awk '{ print $1 }'`;** if ( $count == 0 ){ print "Host : $myHost is down (pint failed) at $date \n"; } #else { #print "\n Host : $myHost is up at $date \ (HowTos)