Hello,
I am executing below perl command.
Code:
# perl -le '@tlinfo = `cat /tmp/hoststemp1`; foreach $j (@tlinfo) { chomp($j); $fqdn = qx(host $j.mydomain.com > /dev/null && echo $j.mydomain.com);$pingstatus = qx(ping -c 1 $fqdn > /dev/null 2>&1 && echo OK || echo Down);chomp($pingstatus);chomp($fqdn);print "$pingstatus";}'
lonlx10401.mydomain.com is alive
OK
lonlx10402.mydomain.com is alive
OK
Down
I do not want "lonlXXX.mydomain.com is alive" this line to be printed. I am only interested in OK or Down output. even if I redirect output and error to /dev/null, this line is getting printed on std output.
Can anyone please help me
--Ravi