The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #3 (permalink)  
Old 04-27-2008
fpmurphy's Avatar
fpmurphy fpmurphy is offline Forum Staff  
Moderator
  
 

Join Date: Dec 2003
Location: Florida
Posts: 1,935
typo: inpt ---> input

Code:
ping -c 1 otherhost | while read input; do
  date +"%I:%M:%S %p <-> $input"
done

Also note that "%r" can be used instead of "%I:%M:%S %p" as in

Code:
ping -c 1 otherhost | while read input; do
  date +%r" <-> $input"
done