*BSD News Article 8739


Return to BSD News archive

Newsgroups: comp.unix.bsd
Path: sserve!manuel.anu.edu.au!munnari.oz.au!news.hawaii.edu!ames!agate!spool.mu.edu!umn.edu!lynx!ankh.unm.edu!hamjavar
From: hamjavar@ankh.unm.edu (Farid Hamjavar)
Subject: Broken pipe
Message-ID: <l80q4s_@lynx.unm.edu>
Date: Fri, 11 Dec 92 07:01:47 GMT
Organization: University of New Mexico, Albuquerque
Lines: 51




Season's greetings :


The following simple csh script keeps pinging some ip numbers.
And store the result in a file named to that ip number.
There is really no problem with this script execpt that I wanted it
to append  "date" before redirecting result of ping into that file.
and after 50-60 round it says "Broken pipe" at line which is  marked by
'Here>'


If you like, please respond by e-mail and if there is a lot of responses
( > 5) , I will post a summary for everyone.

Thank you.
Farid Hamjavar
hamjavar@carina.unm.edu
University of New Mexico 



@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

#!/bin/csh


set _path = "~hamjavar/_w/apsys/ip/ping"
set ip_list = `cat $_path/data`
@ size = $#ip_list
@ run_indx = 1
touch $_path/result
Loop:
@ indx = 1

while ($indx <= $size)
       if !(-e $_path/$ip_list[$indx]) touch $_path/$ip_list[$indx]
 Here> echo `date` >> $_path/$ip_list[$indx]
       /etc/ping $ip_list[$indx] >>  $_path/$ip_list[$indx]      
       @ indx++
end

echo "Finished run $run_indx  at `date`" >> $_path/result
@ run_indx++
fgrep alive $_path/129* >> $_path/result
goto Loop
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@