Operating System - HP-UX
1827870 Members
1260 Online
109969 Solutions
New Discussion

Problem using "ping" in shell script

 
Kenneth Leung_2
Frequent Advisor

Problem using "ping" in shell script

I got a script (Sorry it is on solaris 8) with the ping command as below:

/usr/sbin/ping -s $HOST 16 10 >> $LOG


However, the result in $LOG content useless line as below:

PING ctg-fid-01: 16 data bytes
24 bytes from ctg-fid-01.hk.hibm.hsbc (130.1.73.10): icmp_seq=0. time=1. ms
ICMP Time exceeded in transit from 130.20.61.254
for udp from hk-fid-01 (130.20.61.20) to ctg-fid-01.hk.hibm.hsbc (130.1.73.10) port 33434
ICMP Time exceeded in transit from 130.20.61.254
for udp from hk-fid-01 (130.20.61.20) to ctg-fid-01.hk.hibm.hsbc (130.1.73.10) port 33435
ICMP Time exceeded in transit from 130.20.61.254
for udp from hk-fid-01 (130.20.61.20) to ctg-fid-01.hk.hibm.hsbc (130.1.73.10) port 33436
ICMP Time exceeded in transit from 130.2.16.173
for udp from hk-fid-01 (130.20.61.20) to ctg-fid-01.hk.hibm.hsbc (130.1.73.10) port 33437
ICMP Time exceeded in transit from 130.2.16.173
for udp from hk-fid-01 (130.20.61.20) to ctg-fid-01.hk.hibm.hsbc (130.1.73.10) port 33438


How can I skip these lines from being logged into $LOG? Please help. Thanks a lot.
3 REPLIES 3
Mustafa Gulercan
Respected Contributor

Re: Problem using "ping" in shell script

hi;
don't use -s parameter
there is no -s parameter on HP-UX for ping command.

regards;
mustafa
Borislav Perkov
Respected Contributor

Re: Problem using "ping" in shell script

Hi,
Solaris generates this message when hop-limit becomes zero. Better look for thin on SunSolaris site.
Regards,
Borislav
Borislav Perkov
Respected Contributor