Unix/Linux Go Back    


UNIX and Linux Applications Discuss UNIX and Linux software applications. This includes SQL, Databases, Middleware, MOM, SOA, EDA, CEP, BI, BPM and similar topics.

Script help with awk/ping

UNIX and Linux Applications


Tags
awk, ping command, script, unix

Closed    
 
Thread Tools Search this Thread Display Modes
    #1  
Old Unix and Linux 12-07-2015
5sku5 5sku5 is offline
Registered User
 
Join Date: Dec 2015
Last Activity: 7 December 2015, 12:20 AM EST
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Script help with awk/ping

I need to ping a host website ...like facebook.com and out the seconds of delay for 5 websites ..I need help writing a script that will print the bold


PING facebook.com (173.252.90.36) 56(84) bytes of data.
64 bytes from edge-star-mini-shv-13-atn1.facebook.com (173.252.90.36): icmp_req=1 ttl=76 time=74.0 ms

--- facebook.com ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 74.087/74.087/74.087/0.000 ms
PING pbs.org (23.21.237.247) 56(84) bytes of data.


Code:
for websites in `cat hosts`

do
ping -c 1 $websites >> pingwebsites


echo "Please wait. Waiting to find the host with the highest delay !!!--->"

 awk ' { print $2,  $8 } ' pingwebsites >pingtimes

Sponsored Links
    #2  
Old Unix and Linux 12-07-2015
Don Cragun's Unix or Linux Image
Don Cragun Don Cragun is online now Forum Staff  
Administrator
 
Join Date: Jul 2012
Last Activity: 24 January 2017, 9:52 AM EST
Location: San Jose, CA, USA
Posts: 9,883
Thanks: 477
Thanked 3,391 Times in 2,896 Posts
Moderator's Comments:
Script help with awk/ping This thread is a duplicate of Pinging Host.

Post any responses you may have on this topic in the other thread.

This thread is closed.
Sponsored Links
Closed

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Linux More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Need bash script to ping the servers and rename the output file each time the script is ran madhudeva Shell Programming and Scripting 4 07-13-2012 05:24 AM
Animation Ping on Solaris Like Cisco Ping gokcell Shell Programming and Scripting 1 12-04-2011 05:12 AM
Router ping log extract data from it Awk/Sed/grep jkmistry Shell Programming and Scripting 2 09-16-2011 05:26 AM
Help with Ping Script and AWK stacky69 Shell Programming and Scripting 3 11-04-2010 04:42 PM
Using AWK for ping and print.. hutch770 UNIX for Dummies Questions & Answers 5 09-29-2005 08:49 PM



All times are GMT -4. The time now is 11:12 AM.